❔ help
I have a prblm in my game its about jumping if I press space for jumping like 3 time in a row my player will jump 3 times I want it to only jump 1 time can anyone help? This is my code
2 Replies
First of, a badly lit photograph of your screen is pretty much the worst possible way to share code. If there isn't a lot of it, paste it in here.
Second, your question is a bit vague. What exactly is it you want to happen? Block jumping while your character is in the air?
Depending on how you do collision, you probably want a simple bool like
isOnGround
or similar, set it to false on jump, check every frame if your character has collided with the floor again and only fire the jump if isOnGround
is true.Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.