How do i play state animation but also keep the player "alive" by playing the idle state animation?

The Grounded state is the idle animation.
the problem is when there is a transition to the Pointing Start state and while it’s playing the animation in the state the player is frozen because it’s not playing also the idle state the Grounded.

i want that when it’s playing the Pointing Start state that the player will be alive not frozen…
the question is how to blend both the Pointing Start and the Grounded (Idle) to play at the same time?

Have you tried override layers in the animator? You add an override layer, put Pointing anims in the override layer. In the layer you give a mask that only includes the bones you want to control during Pointing. So both Grounded and Pointing can play simultaneously.

1 Like

i did it now but i see both states animation are playing the same time but in the Pointing layer i need to set the Weight to 1 from 0 to 1 else it will not working with the pointing animation state but if i set it to 1 again the player is frozen i see the Grounded (Idle) animation playing but since the Pointing weight is 1 it’s overriding the Grounded idle.

the base layer weight is set to 1 already and grayed out disabled i can’t change it. the Pointing layer i can set the weight to 1 but then when both weight set to 1 the player is frozen again when pointing.

this is how i’m doing it in the script:

// Manage pointing state and animation
if (fingerPointing)
{
    // Ensure the Pointing layer is fully influencing the character's animation
    animator.SetLayerWeight(1, 1.0f);  // Assuming layer 1 is the Pointing layer
    animator.SetBool("Pointing", true);

    // Enable and draw the line from the finger to the target
    fingerLineRenderer.enabled = true;
    fingerLineRenderer.SetPosition(0, finger.position);
    fingerLineRenderer.SetPosition(1, primaryTarget.position);
}

and the animator controller with the new layer:
the starting of the weight is 0 but i change it in the script.

But you need to create an avatar mask for the Pointing layer and assign it to the layer. It the mask should just contain the bones in the rig you want to control in pointing anim. Click on the gear icon on the layer, you should see a mask slot.

Later you could try switching to Additive blending instead of override and see which one works best.

1 Like