How do i know if my character is touching the ground


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)




More Info About UCharacterMovementComponent:

I hope it helps!



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