How do i know if my character is touching the ground

Hi,

I just started learning UE4 and im trying to create a flying character in a code third personne template.

For now what i did is just add the launch function to jump so if someone spam space he can “fly” but what i want to do is when my character jump it stay if the same Y. My solution for that is to overload the tick function and do a
if (in the air)
{
launch(Gravity force);
}
so he wont move but the if is the probleme here, i dont know how to check if my character is in the air.

If you used the Third Person Template’s character class then you must have an UCharacterMovementComponent component. This component has an accessor which returns if the player Is Flying (aka in Air)

IsFlying:

https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/GameFramework/UCharacterMovementComponent/IsFlying/index.html

Or

IsMovingOnGround:

More Info About UCharacterMovementComponent:

https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/GameFramework/UCharacterMovementComponent/index.html

I hope it helps!

Cheers,

Azarus

even tho its been a pretty long time, i want to thank you :slight_smile: this really helped, mainly the UCharacterMovementComponent ,even tho i had a hard time finding how to use it x). thank you!

IsMovingOnGround works with the blueprint in the new fps player template for unreal , if you see this