How would a double jump work?

Hey, I don’t need any complete scripts or anything, but can anyone help explain how I would go about making a double jump system. I wouldn’t say I’m a noob level developer, but this is definitely something I don’t know how to do and something I would love to learn.

2 Likes

TL;DR:
On JumpRequest, if the player hasn’t already double jumped since being in a grounded HumanoidState, set Humanoid.Jump to true.

Here are some tutorials:

https://www.reddit.com/r/robloxgamedev/comments/12jbnqh/creating_a_double_jump_script_in_roblox_a/

1 Like

Thanks a ton! I’ll check out the tutorials more tomorrow, but this seems like what i was looking for

hello thank you for linking my post but also just wanted to chime in because i wrote that post a bit over 2 years ago… it’s old and out of date

at its most simple form, and only speaking because i’ve tried pretty much everything, also:

reading whether the character is in-air or not:

Humanoids have an easily accessible/readable FloorMaterial property that is more constent than Humanoid:GetState() / Humanoid.StateChanged, as getstate/statechanged sometimes either skips a state(s) or state changes never fire and therefore can’t really be read

reading whether the character records a jump input:

UIS.JumpRequest satisfies reading jump inputs across all platforms, which is a huge thing when writing movement systems. however it is important to note that it fires erratically so applying something like a debounce will help

later on as you (@ op) improve, i’d suggest looking more into UserInputService to read jump inputs from pc/controller, and connecting events from TouchGui.TouchControlFrame.JumpButton to read inputs from mobile. until recently this is what i did when writing my movement systems

applying the double jump:

for double-jumps in specific, i directly write to RootPart.AssemblyLinearVelocity after neutralizing/normalizing the assemblylinearvelocity along the Y-axis. this is to allow any horizontally-applied speed prior to double-jumping to carry on after the input. it kinda makes the movement feel more fluid and smooth. its also the simplest, bodymover-less way to apply velocity to a rig/character

RootPart.AssemblyLinearVelocity *= Vector3.new(1, 0 ,1) – kill gravity (y-axis), retain lateral speed
RootPart.AssemblyLinearVelocity += Vector3.new(0, jumpvelocity, 0) – apply jump velocity

2 Likes

This will definitely help, thank you for writing this

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.