Download

How to add a falling animation?

Does anyone know a beginner-friendly method of how I can add a falling animation to my character’s animation blueprint? Recently, due to my own lack of experience with Unreal Engine, I’ve been working on implementing the jump function using the default SideScrollerCharacter’s animation blueprint as a foundation to expand upon.

I managed to get it working with my own character’s original animations and now I want to further expand on my character’s animations by adding the falling animations I made but haven’t implemented yet. Unfortunately though, I’ve been having a tough time of finding any tutorials for beginners on how to accomplish this and so I’ve come here for help on this matter.

Animation Blueprint Event Graph:

when is something falling?
When the Z Velocity is negative.

I get that, I just don’t know how to implement it into the blueprint. I know that I need to create a Falling variable separate from the Airborne variable I created for the jumping animations, but that’s about all I know.

Well “is in air” is usually used to determine if the player is off the ground and can only tell if the player is off the ground as in a jump but what it does not tell you is how far off the ground is the player as in the state of falling.

Since the player is always in a constant state of falling you could use a line trace to calculate how far off the ground the player is once the player is in the air.

https://www.youtube.com/watch?v=6ZFnPliFSX0

A line trace will return a fair number of variables one being the location of where the trace hits an object, assuming ground distance, you can then have a few different values as to what happens when the player is falling while in air.

Based on the return value.

Is the player jumping?
Is the player falling?
Can the player survive the fall?

I created a new Blendspace that combines the Jumping animation with the Falling animation based on this tutorial I found. I also created a new animation for transitioning from the idle animation into the falling animation. However, the problem now is how I incorporate the transitional animations into the state machine since the Is Falling component doesn’t distinguish between whether or not character is jumping or falling.

Is it possible for the Transition Rule to have a setup where the IsFalling variable is connected to a branch condition which would use the zVelocity variable used in the Jump/Fall Blendspace to determine whether or not the Transition Rule goes into effect? If not, is there anything else that can be used to distinguish jumping or falling for the Transition Rule? FrankieV suggested using line trace but I have absolutely zero experience with it and watching the linked video only made things even more confusing for me.

Anyways, I created a flowchart illustrating my new theoretical setup for incorporating the falling animation, I hope this helps in trying to figure out how to make this whole thing work.

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

1 Like

Thanks for finding that, although I haven’t been able to replicate this blueprint.

I can’t seem to find the Character Movement node, whatever that node is with the multiple outputs reading Velocity X, Velocity Y & Velocity Z, and I don’t know what that node is connected to the Movement Mode node.

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

1 Like

Okay, so I changed the Event Graph in my character’s animation BP to look the one in the screenshot you posted.

However, I am still having some problems in implementing the falling animation such as how I can’t hook up the Character Movement variable to the Movement Mode.

There’s also the problem of this node. I have no idea what is and I am unable to find it in the list of Actions.

unknown_component.png

Then there’s the issue of the Transition Rule for transitioning from the Jumping/Falling animation to the Landing animation. The problem is that the Transition Rule used the Airborne variable and now that the variable is no longer in use, the Landing animation no longer plays like it should.

landing_transition.png

My bad, you need to cast to your character before setting the character movement component (promoting the variable without casting gave you a pawn movement component instead of your character movement component) :

Now that your movement component is correctly set you should be able to get the movement mode :



And for the transition to landing, the movement mode must different to falling (type “=” and grab “not equal enum”) :

1 Like

might need some thought that, is mistaking velocity with direction

try this Anmerkung-20190515-193937.png

It still isn’t working :(, for some reason it now plays the Fall_Start animation when jumping & falling despite the fact that the Fall_Start animation isn’t currently hooked up to anything. In addition, every time I quit playing I get the following error message:

I have absolutely no idea what this error message is about, on top of my animation blueprint setup playing the wrong animation. Not helping matters is that this whole endeavor is starting to feel like a giant byzantine mess that I can’t even begin to decipher. Can anyone else make sense of this insanity and help me figure out what is wrong?

Character Animation Event Graph:

State Machine Setup:

Idle/Walk/Run > Jump Start:

Idle/Walk/Run > Jump Loop:

Jump Start > Jump Loop:

Jump Loop > Landing:
jump_loop_to_landing.png

Landing > Idle/Walk/Run:

First error I see is in your transition from idle to jump start, the movement must be equal to falling instead of different to

Second error in your transition from jump loop to landing, you are using your aiborne variable which is not set anywhere, use instead your movement component->different to falling

Then it is not really an error but instead of using “time remaining (ratio)” try to use “Time remaining” < 0.1 ( for both “landing>idle” and “jump start>jump loop” transitions)

Also instead of using begin play try to use “event blueprint initialize animation”
A last thing to check is that your animations, exept fall loop, are not set to looping

1 Like

I did all the things you’ve suggested (except for changing the time remaining to < 0.1 because it causes problems with my animations, 0.5 I find works a lot for me) and it has fixed a number of issues such as the error messages I was getting but I’m still having issues.

The problem is that now when my character jumps he looks like this while either jumping or falling:

midair_problem.jpg
At first I thought my character was stuck in the default T-Pose while in mid-air, but after checking the Jump/Falling Blendspace animation file I discovered the actual problem. The problem was that my character was actually stuck in-between the jumping and falling animations with no way to transition between the two animations. The reason for this was because the Jump/Fall Blendspace was setup to transition from the jumping animation to the falling animation with a variable called zVelocity, but the current Blueprint setup doesn’t take that variable into account, so the Blendspace cannot transition from one animation to the other.

Since that setup wasn’t working I decided to go with another idea I had. Since I originally created the jumping & falling animations in multiple pieces, I decided to instead string all of the various pieces together without using the Blendspace file.

Unfortunately, this didn’t work out either as my character would instead use the falling animation for jumping in addition to falling.

As far as I can tell, the problem seems to be that the animation blueprint doesn’t distinguish between the act of jumping or falling and as a result it ends up only using one of the animations for both actions.

Both the Jump Loop > Jump to Falling & Idle/Walk/Run > Fall Start transition rules use the exact same setup while the Landing transition instead uses a Not Equal to Falling component. Is the fact that the former two mentioned transition rules as well as the *Blendspace to Jump Start *rule all use the Equal to Falling component a possible source of the issue or is there something else I’m missing?

Jump Loop > Jump to Falling & Idle/Walk/Run > Fall Start transition rule:

*Landing *rule transition:

*Blendspace to Jump Start *rule transition:

Also, I made sure make a copy of my project before I overhauled the animation blueprint just to be on the safe side, just in case I need to revert back to the first setup. So I was wondering which setup is more preferable for the animation blueprint?

A blendspace is used to blend beetween anims, not to transition (technically it can do it but you would have to increase your zVelocity variable in the same time in the event graph, not the simplest method). In the case of an in air blendspace, it would be ok if the blendspace is made to blend beetween for example direction or maybe the speed or maybe the distance to the ground.
Now in your case and from what I’ve understood, you have several animations to stitch one after another, so your second set up is more adapted.

For transitions now, here is what you can do :


Green : remaining time<0.1 (or 0.5 but transitioning too soon will loose your last frame of animation)
Yellow: character movement->movement mode->is different from falling
Purple : character movement->movement mode->is equal to falling AND velocity>0 (you can eventually set the priority to 1)
Blue : character movement->movement mode->is equal to falling ( you can eventually set the priority to 0)

I would say also that the anim used in the “fall loop” has to be the only one looping. You have the “jump loop” which I guess is not looping and should be renamed something like “jump apex” (it is just a guess since I can’t see what your anims look like)

1 Like

I’m pretty sure that for the most part this is how my animation blueprint is already setup:

Idle/Walk/Run > Jump Start rule transition:

Idle/Walk/Run > Falling:

*Jump Start > Jump Loop:

Fall Start > Fall Loop:*

Jump Loop > Jump to Falling:

Jump to Falling > Fall Loop:

Fall Loop > Landing:

Landing > Idle/Walk/Run:

The only differences I could see were the part about priority, which I assume is this:
b30efb3cf68c880817c79304f39061f095ce3ffd.png
I tried changing the priority like you suggested but it doesn’t make any difference at all.

The only other difference I noticed is with the Jump Loop > Jump to Falling transition rule. In your setup you have transition rule as Time Remaining < 0.1, whereas in mine the transition is Movement Component > Movement Mode > Is Equal to Falling. The reason I have it setup like this is so that Jump Loop animation would transition into the Jumping to Falling animation when the character’s Z Velocity began to decrease downward. I’m pretty sure it doesn’t work because the condition calls for the character to be mid-air while the condition for jumping to begin with already calls for the character to be in mid-air. However, this issue is not what is causing the main problem as I tried changing the rule transition to Time Remaining < 0.5 like you suggested and nothing changed.

Actually it is a looping animation, as the character is supposed to remain in a continuously looping animation while ascending upwards before transitioning to the falling looping animation when they begin to move downwards. This is done in order to accommodate things that would also launch the character into the air besides jumping such as bouncing on a jump pad which would result in the character being suspended in mid-air for a longer period of time than their regular jump.

As for the main problem, as far as I can tell, the problem seems to be the jumping and falling animations both have Falling conditions but since the jumping animation also a secondary condition to be met, the falling animation ends up completely overriding the jumping animation. I feel like in order to make it work I need to somehow separate the falling condition into two seperate conditions: a upward movement condition for jumping and a downward movement condition for falling. I tried setting up a similar transition rule as the Idle/Walk/Run > Jump Start one with the Idle/Walk/Run > Fall Start transition rule. The only difference being the Lesser than 0.0 Velocity Z condition rather the Greater than 0.0 Velocity Z condition of the Idle/Walk/Run > Jump Start transition rule.
b6da66ecca481731b9108408c7d3c35f2f9490d1.png
It didn’t work but I didn’t really expect it to, I just didn’t know else to try.

Would you mind sharing the character with animBP and animations? It would be easier to have a look

1 Like

Would really suggest that or use the debug tools, you can then see in effect which route the state machine is taking while playing or check how or if variables are reading (or even if) as expected, i have just set up my own character that is switching from walking to flying or to falling these last few weeks and tbh the debug stuff has helped me solve all issues so far, really helps to see the stuff in action though.

This is exactly what I would like to do with his project :slight_smile: !!

1 Like