- Home /
Double jump problem C#
Hi, I got this problem where I don't want a double jump in my script. Can anyone help me?
Answer by shadowpuppet · May 22, 2020 at 03:29 PM
Yes, need to see the code. But you need to tell the game the player is already jumping. Make a bool "Jumping" and have that as a condition for him to be able to jump
bool Jumping;
if (Input.GetKeyDown(KeyCode.Space)&&Jumping==false){
//jump code here
Jumping =true;
}
//then set Jumping = false when player his on ground
Answer by logane616 · May 22, 2020 at 02:45 PM
It's hard to help without seeing your code, but it sounds like you need to store a variable that tells whether the player is on the ground, and then have him/her only jump if this variable is true.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Uncrouch on realese? 1 Answer
When stopping Rigidbody.velocity 1 frame stutter C# 0 Answers
Align Player to Regional Up Direction, Without Altering Look Direction Dramatically 0 Answers