How do we make a wall running script on roblox

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

4 Likes

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 have any other questions, let me know.

Good luck!

3 Likes

Thank you very much, and also I just got my membership on the dev forums today so I am still kinda new.

2 Likes

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
3 Likes

Thank you I will check this script out

Sorry if the spacing is incorrect, I wrote this on devforum so you may need to fix spacing :sweat_smile:

4 Likes

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.

:thonkang:

1 Like

Yeah, Iā€™m not the best scripterā€¦ Anyways @XxVampireConorxX do what Fifkee said. :sweat_smile:

1 Like

Quick tip:

Instead of doing:

if debounce == true then

You can just do:

if debounce then

Same thing to check if debounce is false, instead of doing:

if debounce == false then

You can just do:

if not debounce then

You can check this post out:

It may help.

1 Like

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.

If youā€™d like to check it out itā€™s Here

1 Like

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

If anyone can, please help

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. :swag:

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.

1 Like