Make the player jump a certain height in my project.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Yasin

In my project If i press the jump button the player jumps a certain height. If I press and keep holding the jump button the player will keeping jumping more than the certain height. How can I stop it such that 1.when I press the jump button and and keep holding the jump button ; The player should jump the same height In both the situation (1 & 2).
Here is the Project

:bust_in_silhouette: Reply From: njamster

Well, as long as you keep the following lines:

if not jump_released:
    grav *= low_jump_gravity_scale

that won’t change. You simply apply less gravity, when the player holds the up-key.

I set the var low_jump_gravity_scale = 0.9. Now it is working fine.
Thank you.

Yasin | 2020-08-09 14:04