Greetings,
In my game, I have two upgrades. One that allows the player to glide, and another that allows the player to fly
I want to make the gliding and flying feel smooth and good to use, thus, I would like for the changes in falling speed to be gradual rather than instant
So this is the code I use:
However, the results are pretty glitchy. If I press the jump button WHILE I’m falling, the gliding and flying works just fine. But if I’m STILL HOLDING the jump button when I start to fall, the states kind of flicker, and the player delays in the air for a short time before gliding or flying
Gliding:
Notice here how the airstate flickers between none and glide. Also notice how the player does this small “hop” before the glide begins
Flying:
Here, notice the airstate flickering again, as well as how the player sort of stalls in midair before flying
Again, this only happens if I continue to hold the jump button when I begin to fall
Can someone please help? How can I remove that “hop” from the glide, and the “stall” from the flying? Do I need to set up the math or the code differently?
Thanks