[FreeFall] // Detection above the ground

Hello guys Happy New Year !
I would like to know if somebody has actually write a code to detect the ground with raycast or any else method for falling event.
I explain :
I would like my player to detect the ground with the lower tick rate as possible, and when it no longer detects the ground a event is created to activate a skydive type animation, the goal being that when the player remains on the ground, the animation does not playt, but when the player jumps and the detection of the ground is too far away, the animation is activated, and the player can control the free fall.
I’ve search a tons on EPIC youtube content or Blueprint website, but not succefully, can you guys help me with that or it’s probably to technical ??
Thank you all,

#include C.Donatien .h :stuck_out_tongue:

Hi man
You can use linetrace by channel blueprint,
You can cast a line between the actor world location, and the same location + a vector like 0,0,-300.
This will cast a ray from your char to under him for 300 units.
Check if the ray get a hit result to start the animation or not.

I’ve seen this kind of behavior in games. Usually the player falls normally and then switches animations to a free fall or similar. Couldn’t you check how long the player has been in air so that your anim bp switches from the normal jump fall into free fall?

The raycast method works as well if you want a more instant change. Although you still need to detect distance from ground based on the player’s situation. Has the player jumped? And/or are they falling (slightly different than jump).

Binding a timer to Jump Apex could handle starting this check but if the player runs off a ledge, they fall, not jump, but would still play the falling animation. This leads back to checking for how long they have been in the air in the anim bp since it’s already doing this check per frame. And checking a float is faster than performing many line traces.

But you can just use the function “Is Falling” from Character Movement to auto detect when the character it’s falling and you don’t need to check when the character jumped and when falled from a ledge. I’ll use the line trace option.

I have not found this as reliable as it should be. Perhaps it’s whatever other stuff I have going on in my character blueprints.

Edit: I realized that Is falling is a pure function, there is no call for it, so it is not an event. You still have to check for it somehow.

Sure, you can check it in tick event, or call a custom event branching from is falling from main event Jump and system event Fall from ledge.

This is true. I still prefer to check this in the anim bp since it already has a tick event being used and it is meant to change the animation state anyways. Why have the character blueprint check this when the animation needs to know about it?

Is Falling is set immediately on jump (CMC). You can use this state to trigger actor to ground checks at intervals (timer). Event on landed can be used to turn off the checks (clear timer).

When you get the desired distance simply set a transition state boolean or whatever var for your anim BP to use (state machine transitions).

Est_engine //ConradG //MetisConnetis // Thank you guys, that truly help me to approaching for my wish, as a total newbie with ue4 i’ve quit Unity since 3 months as a level designer, animator and 3d modeller, i’ve started learning the c++ and blueprint since this 3 months, i know that the road will be very long, and thankfully you guys are very responsive, i’ll come oftently here :rolleyes:. there a picture of the BP i’ve made for detecting, i will implementing the animation state for the transition and adding a c++ raycast or a timmer to drive the time during a potentiel long fall, hope you’ll be there guys thank you one time more :wink: