I’m currently working on the 3rd person C++ example provided by Unreal and I’m wondering how to detect when the character is falling. I’ve found the “Landed” event in blueprint, but can’t seem to find when falling starts. The reason I’m asking is when the user walks off a ledge I want them to transfer to a skydiving posture. I’ve noticed this happens in the animation (transfers to the falling animation) but I’m not sure how that works either. Maybe that would be a better place to start?
There is two options you have, one is simpler than the other. Both options are really only use for people using Character Animations like in your case.
The first would be to go straight for the falling motion. So you need to get the Pawn (or Character as long as its parent is Pawn) Blueprint Class, pick from it and retrieve Character Movement Component. From there you can get the function Is Falling.
Second option is similar but with slightly more controlled results. Also can only be pulled from the Character class as far as I know. Instead of picking Is Falling from the Character Movement Component, pick Movement Mode. Which will given you an Enum of every state available. Allowing you to either Switch or Select from the Enum for maximum control.
So here is the State Machine with a jump up, loop and down (you can check this video - YouTube). So what I did is that I took Idle, Idle Gun, Aiming,etc. Almost all animation and connected them to jump_loop_gun like entrace and exit with jump_down_gun so the transition rule in entrace is “IsFalling?” and if yes, you transit and exit when is not falling. (It allows me to fall in any animation)
Which means that the exit transition is “IsFalling ---- NOT ---- (Can Enter Transition)”.
Certainly the best choice, which allows you to do a lot of thing like swimming (I just discovered it).
And they’re working exactly the same. And if you like tinkering, I think you can do some great things with that.
So thanks to PeterLNewton for the info, It really helped me going further in my game