Animation Blueprints & State Machines

🏃 Animation Blueprints, BlendSpaces & State Machines in UE5

An Animation Blueprint (UAnimInstance) controls the frame-by-frame skeletal deformation of a character in Unreal Engine 5. It separates variable processing (EventGraph) from pose evaluation (AnimGraph).


🏛️ EventGraph vs. AnimGraph

+-------------------------------------------------------------+
| 1. EventGraph (Thread: Worker / Game Thread)                |
|    - Reads character velocity, ground state, rotation       |
|    - Caches variables into fast primitive floats/bools      |
+-------------------------------------------------------------+
                              │
                              ▼
+-------------------------------------------------------------+
| 2. AnimGraph (Thread: Parallel Animation Evaluation Task)   |
|    - Evaluates State Machines (Idle -> Walk -> Run)         |
|    - Evaluates BlendSpaces & Layered Bone Blends            |
|    - Applies Control Rig IK foot solvers                    |
+-------------------------------------------------------------+

⚡ 1. Thread Safety & Property Access in UE5

To enable Fast Path evaluation and run animation calculations multithreaded across all CPU cores:

void UMyAnimInstance::NativeUpdateAnimation(float DeltaSeconds)
{
    Super::NativeUpdateAnimation(DeltaSeconds);

    if (APawn* Owner = TryGetPawnOwner())
    {
        GroundSpeed = Owner->GetVelocity().Size2D();
        bIsFalling = Owner->GetMovementComponent()->IsFalling();
    }
}