so I want to make a parkour game and I want to add certain movements, I am very new to scripting and would like to know how I could add a wall running script. For more detail I want to know how to make a wall running script similar to Karlson 3D and Roblox parkour (PARKOUR - Roblox)
If anyone could help like showing how to make a wall running animation and when next to the wall it plays the animation. I will try to answer any question for detail and examples
Hey there,
Scripting support is really meant for us to be able to help fix broken/unintended behaviors in code. It is quite difficult to explain how to do a full system, and while I have not looked at the game you linked, Iām sure it took some time for the developers to create. However, I have provided some resources regarding animations that may be of help. This article talks about the animation system as a whole: Using Animations | Documentation - Roblox Creator Hub This API describes the Animation object and its related articles: Animation | Documentation - Roblox Creator Hub
If you want a animation to load when someone touches a wall then do
local wall = script.Parent
local anim = script.Parent:WaitForChild("YourAnimationName")
debounce = false
wall.Touched:Connect(function()
debounce = true
if debounce == true then
--load animation, look into scripting to do this because i dont really wanna do a whole for i,v
end
if not debounce == true then
debounce = false
end
end
The last if statement is unnecessary unless youāre for some reason setting debounce to another data type. Otherwise, you can just set the variable to false.
You also shouldnāt have to use :WaitForChild on the server unless what youāre expecting isnāt there when the server starts.
Wallrunning is especially difficult. I also recently started making a Parkour game and i found using Body Positions great in this case. I recommend using lookVector for Positioning.
I tried many Body classes but i found BodyPosition to work best for what i felt like fit.
I havenāt tried to create wallrunning yet although i think iād go about using Raycasting to detect if there is a wall either at the left / right of the character. Using HumanoidRootPart as a base to cast them and detect.
I now have some more questions after adding the script
This is my script currently
local wall = script.Parent
local anim = script.Parent:WaitForChild(āwall run testā)
debounce = false
wall.Touched:Connect(function()
debounce = true
if debounce == true then
local animationTrack = humanoid:LoadAnimation(animation)
animationTrack:Play(4918624651)
end
if not debounce == true then
debounce = false
end
end
a error appears
Error: (14,4) Expected ā)ā (to close ā(ā at line 5), got eof
eof is in the <> brackets an I am not sure what this error means
another question is where do I put the script, must be a local script, and should I put it in StarterPlayerScripts folder
ok so in line 7 you need to do Humanoid:LoadAnimation(anim), and for line 8 you need to get rid of the numbers inside the brackets of Play(). Also you havenāt defined what has touched the wall, check if a child of the model has a humanoid, if so, load the animation. Hope this helps. Also that error might be because of your end structure, so try rewriting that, I didnāt write it on roblox studio so the end structure is probably the issue. This is supposed to be a script inside of the wall you have, serverscript also.
the way I am telling you to do this probably isnāt very efficient, just gives the effect of wall running. you probably want to do what @Snoopy1333 suggested when you get better at scripting.