|Attention||Topic was automatically imported from the old Question2Answer platform.|
|Old Version||Published before Godot 3 was released.|
Hey guys, I have a little question.
I’m making a character control script for my platform game project and I struggle with a little detail…
here’s my code :
if Input.is_action_pressed("ui_accept"): if grounded: jump(jumpForce);
Simple, but my problem is that if i keep m’y jump button pressed, my character will jump again and i don’t want that, i want the player to press the button again. It’s important for me cause I also want the same behaviour for my attack action, I don’t want “autofire”.
Can you help me with this?
And keep going! Godot rock!
Well, if jump,
grounded should be turned to false, right?
Remember to turn it to true when hits the ground so it can jump again.
eons | 2016-10-10 13:29
hey, maybe I was not clear with my question (My English is not perfect… so sorry for it).
The problem I have is different, when i press the button, the character jump, no problem with it. But if i keep the button pressed and my character hit the ground, it will jump again.
I don’t want this behaviour, I want the player to release the button then press on jump again if he want to jump a second time.
Do you see what I mean?
c4n4r | 2016-10-10 16:35