# _physics_process
if Input.is_action_just_pressed("jump") and jumps_available > 0:
velocity.y -= 250
jumps_available -= 1
along with some kind of reset condition, such as
# _physics_process
if is_on_floor():
jumps_available = 2
and that should give a rudimentary kind of double-jump functionality.
will floor count as any surface?
PopSquip | 2021-08-31 05:01
I don’t know, it depends on how you move your character and stuff. If you want to reset on more than just hitting the floor, you can add or change the conditions.
CardboardComputers | 2021-08-31 14:07
the code doesn’t work when on a tilemap? how should i fix this?
PopSquip | 2021-08-31 22:55
I don’t know, I don’t know what your code looks like at the moment. If your tilemap has colliders, then chances are you aren’t moving your character in a way that’s compatible with is_on_floor.