Choose your operating system:
Windows
macOS
Linux
Before actually creating your State Machine , it is a good idea to take a little time and plan out exactly which states you will need, as well as the circumstances that will drive transitions between states. This will give you a solid plan of attack for not only the State Machine but also the variables you will need to drive it and which animations will be a part of each state.
You can create a New State Machine inside the AnimGraph of an Animation Blueprint Editor :
-
Right-click within the AnimGraph of your Animation Blueprint and choose State Machines > New State Machine from the context menu.
Generally, it is a good idea to name your State Machine immediately after creation.
-
Right-click the new State Machine in the My Blueprint window and enter a new name in the name field.
In this case, the State Machine has been named "Locomotion."
-
You can open the State Machine to define its States and Transitions by Double-clicking it.
This will open a new graph tab with nothing but an Entry point, which essentially kicks off the animation.
Creating States and Conduits
Creating a new State is similar to creating new nodes within a Blueprint.
-
You can Right-click and create one from the context menu.
You can also drag a wire into an empty portion of the graph and release the mouse, which will also expose the context menu.
-
You can rename your States by Right-clicking the node in the graph.
Above our State has been created and renamed to Idle below.
-
Conduits are created in a similar manner, by either Right-clicking in the graph or dragging a new wire into an empty space on the graph.
Creating Transition Rules
Transition Rules are created automatically along the wires that connect States and Conduits. Graphically, Transition Rules appear as a small circular directional icon, like so:
This means that when you create a new State or Conduit by dragging a wire into an empty space on the graph, a Transition Rule will automatically be created for that wire. Additionally, you can drag a wire back to the original node to create a second Transition Rule for transitioning back to that node.
You can Double-click on a Transition Rule to open a new graph that will allow you to define the success or fail conditions for the transition.
Above if the Boolean IsSecondaryAttacking? is True , then the transition into the new state can occur.