- Home /
About character doublejumping.
Hi. My head hurts and I am exhausted because of a maybe simple problem. ATM my character uses a ray to determine if it is grounded, everything goes jusr fine..but. I need my character to be able to jump lets say 2/3 times ONLY if he Firstly jumped when it was grounded. I dont want it to be able to jump if he is not grounded anymore and if he DIDN'T jumped atleast once. So , start jumping only if grounded, keep jumping for 3 times BUT never be able jump if not grounded AND never jumped before when it was grounded.
hope it makes sense. Any help is GREATLY APPRECIATED.
Answer by ABerlemont · Jan 03, 2014 at 03:37 PM
Concider the jump has a consumable. Everytime the player jump you decrement the number of jump left (class property). If that number is 0 or less don't execute the jump process. That property would "refill" to 3 every time the character touch the ground.
I know that . That works, the issue is that I want it to not be able to jump if he is not grounded and never jumped before. (when it WAS grounded). Like..in mario , could you jump if you were out of the platform ? No you couldnt, same thing must happen here.
Sooooo, you could make a bool state that would change once the first jump was made from the ground. If the player fall and that original state wasn't changed he can't use the multiple jumps.
Your answer
Follow this Question
Related Questions
i'dont want double Jump 1 Answer
How to jump multiple times to mid air? 3 Answers
Let Character Controller jump. 0 Answers
Problem with rotation and groundchek _ 2D - C# 1 Answer
Jumping when not grounded 2 Answers