Hi! First of all I wanna thank you for providing such a clear explanation of your issue Now lemme go over all the possible fixes you can consider implementing.
- I think the reason your character enters the falling state as you spam the input that triggers jumping is because it detects that the player is falling at the times when you give the input slightly before your character lands on the ground. You can fix this by adding a prioritized condition before the transition into the falling state begins, which will be bound to a bool type variable which you can set to true after the âEvent On Landedâ node and set back to false after the jumping node that you trigger on user input.
- Youâre right about that the jumping animation gets triggered when the character falls off a ledge due to the transition condition youâve set there. You can use the same bool type variable we created before to trigger the jumping animation, but this time plug a âNot Boolâ node to it before inserting the final result into the transition condition. Once thatâs done, the jumping animation wonât play when the character falls off a ledge but we still want it to play the falling animation. To do that, you can create a new transition from your walk/run state to the falling state and insert your variable named âIs Falling?â into the transition condition between those.
- You should be able to get the playerâs velocity on z axis by splitting the yellow output pin of the âGet Velocityâ node. You can check if itâs magnitude is greater than 300 and transition into a more intense falling animation if it is. Wait! I was tend to explain how to get the playerâs velocity on z axis because you mentioned that you had troubles on that matter, but on second thought, what you wanna achieve can be done by detecting the airborne time instead of the velocity, as the velocity on z axis wonât change for the entire duration of the fall. As for the revised suggestion, you can get a âSet Timer by Eventâ node, insert the desired value into itâs âtimeâ pin, create a custom event and plug itâs red square pin into the âeventâ pin of the timer. Thatâs done, now get a branch node, plug your âIs Falling?â variable into itâs condition pin and plug the branch node to the Event Tick node. After that, create a new bool type variable which will indicate that the cricital air time has been reached, and set it to false after the branch nodeâs false output pin. Then connect the branch nodeâs true output pin with our timerâs input execution pin. Remember that custom event that weâre dispatching from the timer? Plug the set type node for our critical air time variable to itâs execution pin and set the variable to true. Now instead of the velocity on z axis, you can use this variable to transition into a more intense falling animation.
I hope these can be helpful