Hi guys, I’m implementing jump pressure, if the button is pressed quickly, the character jumps minimally, if it’s pressed for a certain time it goes up more and consequently stays in the air a little longer.
Before everything. I know how the FSM works, I’m just not being able to implement this idea!
But I have a problem touching the wall, when I do that the character simply goes up, until the wall ends or I release the jump button.
Note that I removed the “Trigger once” so that I can be controlling the character in the air, but when it reaches a speed above 300 it should go into the “Falling” state
What I noticed is that when entering the “Falling” state, the character keeps jumping if it’s on a wall, and it doesn’t have a jumping state when it’s “falling”. That is, theoretically, when entering this state, the character should automatically fall and not fly like this…
This only happens with this airtime implementation. If I put the “trigger once” it works normally.
That’s possible - take the case of jump speed being 290, then it’ll increase it by 20, pushing it up to 310.
WRT the FSM, what do you do when the state is falling?
The way I see it from the event’s you’ve posted, if you’ve just set the jump speed to over 300, the simulate jump key has also just been actioned, and the object will need to complete that before gravity takes over.
But then in the event immediately after it, you set the state to falling, even though the jump action from the simulated jump key press still needs to be completed.