UE - How to differentiate falling from jumping in the anim Blueprint Graph?

Hi, I use “Is falling” from the movement component of an actor, for the Event Graph to understand when my actor started jumping and it works great, BUT… now I need to add falling animations to the graph, and I have no idea how differentiate both,

Instead of using “Is falling”, I tried by SET a boolean when my actor starts jumping (whenever a player presses a jump key), and after a while, the boolean turns false, so the graph would understand, that the actor is falling but also jumping… not working, the graph is still getting confused:

image Falling state.

Also tried by setting a higher priority to jumping or to the falling rute, it did nothing; so, using “Is falling” is fantastic for triggering jumping anims, but a chaos for triggering TRUE falling anims, what else may I try? maybe there is a way to figure out if the actor is moving down while falling, since a jump is always up.

Please help, thanks

The smoothest solutions to this that I know of combine the boolean variable approach that you use with the character’s velocity. It goes like this:

  1. Set IsJumping to true when players hit the jump button, set it to false whenever they land (from jumping or falling, doesn’t matter)
  2. While in the air, get the character’s velocity, specifially the upwards motion. As long as the character moves upwards, it’s in jumping mode.
  3. After reaching the highest point, the character starts to accelerate towards the ground again, so the velocity along negative Z will start to grow. This is where you switch from jumping to falling.
  4. Bonus point: as long as the character is falling, the velocity along negative Z will grow until they hit the ground. You can use this value to drive how “frantic” the falling animation should look. At -Z speeds of 2000 or more, for example, the character can start panically waving its arms because it’s racing towards certain death below.

There is also a good chance that the velocity alone will be enough to do what you want so you don’t even need to set a boolean when the jump button is pushed.

2 Likes

Great explanation,

  1. didn’t work… it gets confused with the fact that it is jumping and falling at the same time, and falling comes from “movement” not a Boolean, so I guess it has a higher priority.

  2. this option I think it will work, it seems smart to make it understand that movement is Up, but honestly I´m not sure how to do it in BP, how to take the inwards motion inside the ruto into the fall state, can you please share a pic.

  3. This won’t be a problem, because after the first jump, it changes to “loop” and loop is always falling, this is not a problem at all, I think it is the first movement the problem, like, if you jump in real life, you move up, but if you keep running through a clif you never move up, just fall, so the “jump” is never called, but UE keeps reading both moving up and down as a fall, that’s why the first anim is more complicated (1 and 2).

  4. This wont work because once the anim graph reads “falling” it immediately makes the active state as jump or fall, the way I think it might work, is if it decides it is a jump instead of a fall, It might allow you to flip you out fast from jump to fall… but, it might also cause problems now with the “loop” anims… so complicated omg.

You know when you give the jump command, in the character.
Add another flag in your character class for “is jumping.”
When giving the jump command, set this, and set a timer to clear this after some time, measured based on your jump simulation.
Now, implement accessor functions “MyJumping” and “MyFalling,” where MyJumping returns true if the “ground contact” is false, and the “is jumping” flag is set, and MyFalling returns true if “ground contact” is false, and the “is jumping” flag is clear.
Now, update your animation blueprint to use those accessors to read the state of the character. Done!

1 Like

Also: you might want to use animation notifies to transition into and out of the “is jumping” flag, if you want to drive this with data rather than measured-timing.

I dunno if this might help you in your quest, but perhaps time is what you need to differentiate is falling, but for how long? How to tell (in seconds) how long Is Falling is activated? - #8 by Everynone