How to know if main Pawn is falling?

So I basically need to know if my main pawn is in air(falling). How should I go about finding this?

Two Ways. Attaching Examples.

If you’re using the Character Blueprint Class. You can get the Character Movement and then call function Is Falling?

OR

You can get the velocity of your Pawn, break the Vector, and check if your Z Velocity is negative.

Either of those should suffice!

1 Like

Do you use character as a pawn?

Getting the velocity and checking if the Z Velocity is negative tells you you’re going whichever way is down. So simply, you’re falling.

Well I use the vehicle component, so not really.

Couple of questions with the second approach.

  • Would you have a negative Z velocity if you were standing on an elevator, which was descending?

  • Doesn’t it count as falling as well, if you’re being pushed in the air, meaning your Z velocity is positive?(bomb explodes, pushes you in the air)

  • Wouldn’t it be also good to shoot a ray below your feet each tick, that checks if you’re standing on something or not?

pawn.getMovementBaseActor returns null if the pawn is in the air, or returns the actor the pawn is standing on.

So it was Get Velocity on a Character pawn blueprint. Thanks!!!