Jump not responsive enough

Hi,

While clicking on jump and i mean i mash the keyboard i see the jump only happens now and then, is there a way to smooth out so that it responds really well to the key press.

this is the code i used

i will work twice then for three or 4 press after that does not jump.

image

image of the stage

1 Like

Hi Wesley,

Have you already added a Debug.Log to the first and the second if-block in the Jump method to see which one gets executed during runtime?

Also bear in mind that GetButtonDown gets the state of the key (press down or not pressed down) at the beginning of the frame. If you spam the key within the same frame, Unity doesn’t log the pressed down key multiple times but only once.

so i had a read through my code an noticed that i changed the update method to a Fixedupdate, changing this option back has now made my jump more responsive. : 0 )

1 Like

Well done! Is the issue fixed now? :slight_smile:


See also:

The issue is now fixed :slight_smile: or should i say update haha…

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

Privacy & Terms