Blending animations with Blendspaces

In Mars Marine, we set up our character so that when moving in different directions, we blend between the running animations we have for our marine.

We will be coming back to the animation blueprint later in this section.

What else would you like to learn in regards to animations and characters?

Feel free to post any questions below as always!

1 Like

Hi, unreal 4.22’s Anim Graph don’t need Locomotion ,It is a little not work. Drag and drop directly blendspace to Anim Graph and link.

ok,I understand ,I mix link direction and speed

For those who are using newer version of Unreal ( Using 4.24 ) you’ll notice that Calculate Direction node isn’t a function node anymore, but a Pure function node. Since there’s no execution pin, you won’t be able to hook it up like in the video. I’m sharing the workaround i used in case it’s useful.

. If this is wrong in any way, feel free to correct me, but so far, this work.


Didn’t work for me. It compiled but the animations don’t switch.

Edit: I switched up the movement speed and direction sets and got it fixed.

You can collapse the blueprints in order to get functions made for calculating movement direction and movement speed as seen here. You will need to break the node for the marine into three separate variables in order to do so.

Hey guys, this really threw me for a loop. Thanks for the responses here. In another thread someone had mentioned the ‘green’ node of the ‘Calculate Direction’. Basically to turn this green node into a a function by itself, making it blue and having its own execs to use. After converting this, i was able to hook things up and it work. (the first node still is showing the red arrow leading from update to is valid, but it worked.

I also as a next step was to delete current variable connections from the movement blendspace and then reattach the movement speed and direction. It works now. (after a few hours watching videos ad researching online)

For those having a Problem with the fact, that “Calculate Direction” is now a PURE & CONST function, just ignore the fact, that it has no exec-pin. Just put the Return Value in the SET of you MovementDirection Float like this:


Thanks for the solution. I am working with 4.26 it works fine, thank you for saving my time!

1 Like

sorry to ask what of the is valid

This is used so you don’t need to cast every time the animation is updated. The casting is done once on Begin Play and the result is promoted to a variable that only needs to be checked using the Is Valid macro.
This is much cheaper than casting to a blueprint every time.

There’s a little more to that.

The Update event in Animation Blueprints is actually being executed when we have the editor open with the Animation Blueprint. Since the pawn owner isn’t available at the time, the IsValid check saves us from getting slammed with errors. Which can potentially effect performance in the editor or worse, cause a crash.

1 Like

Thanks for that! I didn’t realise the animation blueprints would run in the editor itself prior to a begin play. Makes sense considering we can view the animation without having to play the game to see it.