top of page

How To Create An Animation Blend Space and Blueprint In Unreal Engine

Updated: Aug 25, 2023

Animation is a vital component that brings characters to life in video games and interactive experiences. It’s super powerful because it provides more immersion in a videogame. In Unreal Engine, Animation Blueprints are the powerful tools that allow you to define and control these animations, making your characters truly come alive.

 


How To Create An Animation Blend Space and Blueprint in Unreal Engine 5


Table Of Contents



Importance:


Animation Blueprints give you the creative freedom to breathe life into your characters. Instead of using a single animation for every scenario, you can dynamically switch between animations based on the character's state. Animation Blueprints make it possible to seamlessly transition between these actions, ensuring that the animations remain fluid and natural.


How to create Animation Blueprint?


In this tutorial, I’ll walk you through all the steps of creating an Animation blueprint and getting it up and running with idle, running and jumping animations.


Import Character and Animations


  • Before the creation of Animation blueprint, the first thing is making sure that your desirable character is rigged with a skeletal mesh and all the animations are ready to import. All of these things can easily be found on a website such as Mixamo.

  • Next, you will need to import these in Unreal Engine and then the animation process can begin.

  • Make sure to assign the skeleton of the character when importing the animation.

FBX Import options


Create An Animation Blueprint

  • The first step is creating the Animation blueprint as well as the Blend Space blueprint. For this, right-click in the content browser and select "Animation" and then “Animation Blueprint”. Name it something like “NewAnim_BP”. This blueprint will be used to setup the conditions under which the animations will happen.


Creating an animation blueprint

  • Now, make a Blend Space blueprint by going to the "Animation" tab again and selecting Legacy. There you will find the “Blend Space 1D” blueprint. This blueprint will essentially transition between animation in a smooth and natural manner.

animation blendspace 1d

Setting up the Blend Space

  • Before working on the Animation, a working Blend space is needed. To do this open up the “Blend space” blueprint and drag the animations onto the timeline. The timeline will determine the speed at which the animations will trigger.

  • Drag all the animations one by one on the timeline and then set the speed at which the character will fully transition into that animation.

  • Place you character's idle animation where it says 0, and place your characters fastest animation, there running one at 500 and you can place animations like your walking animation in between.


animation blendspace 1d

animation blendspace 1d

  • However, one thing to note is that the Blend space we are using is 1-D. It will only be useful for 1-dimensional animations, so make sure to use 1D animations only.


Setting Up The Animation Blueprint

  • Now for the main part of the process, the “Animation Blueprint”. Open up the animation blueprint and make a “State Machine” in the AnimGraph. A State machine will be used for setting up the rules under which animations will be played.

  • Next connect the “State Machine” node with the Output Pose node in the graph.

  • After that, double click on the “State Machine” node. Here we will make several states which will basically swap between different animations based on the condition of the character.

  • Compile and save everything and the first important part of the Animation process is done.

Scripting The Animation


Nodes to be used:

  1. Event Blueprint Update Animation

  2. Try Get Pawn Owner

  3. Get Movement Component

  4. Is Falling

  5. Vector Length

  6. Set Speed


Steps:

  • Before we set up the State Machine nodes, we need to clarify the condition/s under which our character will move or jump.

  • To do this, we will go to the Event graph of the Animation Blueprint. Then we will take a “Try Get Pawn Owner” node and connect it to the “Get Movement Component” node.

  • Then take a “Is Falling” node and promote its Return value to a variable. Name it “is Jumping” and connect it to the “Event Blueprint Update Animation” node.


animation blueprint

  • Now, the “is Falling” node will determine the condition that will initiate the jumping animation of the character. However, we also need to update the other states of animations.

  • For this, take the Return value of “Get Movement Component” node and make a “Get Velocity” node. The date type of velocity we need must be an integer so make a “Vector Length” node from the “Get Velocity” node.

  • After all of this is done we can move on to State Machine.


Setting Up The State Machine


Nodes to be used:

  1. Get Speed

  2. Blend Space

  3. Get Is Jumping

Steps:

  • Firstly, make two states and name them “Walk/Run” and “Jump” respectively.

  • Double click the “Walk/Run” state node and make a “Blend Space” node by dragging the Blend space blueprint inside the graph.

  • Now, connect the “Blend Space” node with a “Get Speed” node and the “Out Animation” Node.

  • After that’s done, go inside the Jump state node and connect the jumping animation with the “Output Animation Pose” node.

animation blueprint

  • Now we only need to set the rules which will transition between the jumping and movement animations

  • First go into the “Walk/Run” to “Jump” rule and just connect a “Get Is Jumping” node to the “Result” node

animation blueprint

animation blueprint

  • Second go into the “Jump” to rule “Walk/Run” and do the same thing. But connect a Not Node in between the “Get Is Jumping” and “Result” node. By doing this the character will go back to performing the movement animations as jump is not being used.

animation blueprint

animation blueprint

  • This marks the end for the Animation part of the process.

Changing The Third Person Mesh

  • After everything is set up correctly, the last step is changing the character mesh and the Animation blueprint as well.

  • To do this, go into the “Third Person Character” Blueprint and then click the “Viewport” tab.

  • Here, you will have to change the default character mesh to the skeletal mesh of the character that was imported.


third person blueprint

  • Choose the new animation blueprint that we made for this character and then compile and save the blueprint.

  • This will change the character and apply the animation blueprint containing the new animations for that character.


Conclusion

  • Congratulations you have made your first animations for the character you wanted. Now it’s time to test it and perfect it.

  • Play the game and observe how the character's animations transition smoothly based on movement input. Then change the animation timings as necessary so it works perfectly with the movement.

To get notified of upcoming posts on Unreal Engine, I invite you to subscribe to our newsletter:




And if you are just getting started learning Unreal Engine, have a look at the Unreal Engine for Beginners Course :

437 views0 comments

Comentários


bottom of page