Unreal Engine 4 Tutorial: How to tell your character is grounded
Tuesday, January 26, 2016
programming
ue4
Intro
This is a very short Unreal Engine 4 tutorial on how to go about telling if a character is grounded or not, using blueprints and the Character Movement component.
There are many reasons why you may want to know this. A very common one is to show the correct animation: running/walking vs jumping.
The Blueprint: Character Grounded Function
Using functions to handle small tasks is great. It helps to keep the Event Graph blueprint small and easier to read.
In this particular example a Boolean variable is updated and stored whenever the character is grounded. Since there is a big chance that the value could be used multiple times is good idea to store it.
Final Thoughts
This method uses Character Movement component.This is not the only way to go about it. If you are not using the Character Movement component you could probably use ray casting or triggers to accomplish the same thing.
Recommended Reading
For those that like to learn from a book here is one I recommend (Amazon):