elif Input.is_action_pressed("jump") and is_on_floor():
motion.y = -800
Also, note that you should update the motion using move_and_slide so the gravity doesnt add while on floor, like this:
motion = move_and_slide(motion, Vector2.UP)
I also added the second parameter as i assume you are making a side scroller from your controlls. The function needs that parameter to know where is the floor.
thank you, i have been stuck on this for hours
fish | 2020-07-30 09:14
No problem. If it worked, you may select the answer so others see its solved!
p7f | 2020-07-30 11:59
I’ve been trying to get is_on_floor() to work for so long! Thank you!