Add delay before jump

How do I add delay before a character jumps when you press the spacebar or the jump button on mobile? I want my animation to first make it look like you are kind of making moves before you can do the jump to make it more realistic. The animation is done but with the default Roblox jump animation settings it straight up skips that part in the animation. I want it to play for like 0.4 or more seconds and then actually jump normally (By just moving the HumanoidRootPart of the character up which Roblox already does).
I don’t know how to do this tho or where to edit it to begin with. Help is appreciated!

userInputService.JumpRequest:Connect is the point where you should begin. You can also copy the charactermodule and edit it to change things up in there.

1 Like

Where in the CharacterModule is the code to make the character jump?

I’m not sure, i’ve never looked through it alot. Try doing your research over it. I also think that the modules are labeled, so it hopefully wouldn’t take long to find it.

1 Like

I have looked through the TouchJump ModuleScript but I don’t see any line in the code which makes you actually go up. :frowning: I’ll continue searching.

Ok I found it inside the “KeyBoard” script inside the Control module inside of PlayerModule which is inside a player when a player joins. I added some delay above line 115 and wrapped it around a spawn(function() so the delay won’t interact with the other parts of the script. It seems to work but I’m not sure if this also works for other types of devices.

Turns out this is just to confirm jumping :confused:

Ok, you should just test it out and see if it works for all devices

Maybe I can start the animation before the confirm delay and then when the player does jump the animation has already started.

You could disable jumping by blocking the request, then, fire a remoteevent whenever a jump request happens, and then wait(cooldown) use Humanoid.Jump to make the player jump and yea you would have it.

2 Likes

That’s a much better idea! Thanks!