Walking animation stuck at the first frame

Hello, hopefully you can help me and thank you if you try:


As you can see above when pressing W/using the Left Stick to go up, the transition takes place, but it freezes on the first frame and it stays exactly as you see it in the screenshot (the progress bar for walk_up).
Apparently it kinda lets the animation work if I check the Exit Time and Transition Duration, but I always unchecked those so I don’t have that delay in between moving directions.

Below is my code, using a basic movement script all worked fine, but trying to make an android game I redid it and now I have this annoying issue.

using UnityEngine;
using UnityEngine.InputSystem;

public class PlayerMovement : MonoBehaviour
{
    public float speed = 5f;
    public Rigidbody2D rb;
    public Animator anim;
    [SerializeField] private InputActionReference moveActionToUse;
    [SerializeField] private float deadZone = 0.1f; // Deadzone pentru gamepad

    private Vector2 moveDirection;

    void Update()
    {
        moveDirection = moveActionToUse.action.ReadValue<Vector2>(); // Citim input-ul o singura data

        // Aplicam deadzone pentru miscarile mici
        if (moveDirection.magnitude < deadZone) 
            moveDirection = Vector2.zero;

        UpdateAnimation();
    }

    void FixedUpdate()
    {
        if (moveDirection.sqrMagnitude > 0.01f)
            rb.linearVelocity = moveDirection * speed;
        else
            rb.linearVelocity = Vector2.zero; // Opreste miscarea cand se opreste
    }

    void UpdateAnimation()
    {
        bool isMoving = moveDirection.sqrMagnitude > 0.01f;
        anim.SetBool("IsMoving", isMoving); // se misca sau nu

        if (isMoving)
        {
            // labareala pt gamepad
            string direction = Mathf.Abs(moveDirection.x) > Mathf.Abs(moveDirection.y) 
                ? (moveDirection.x > 0 ? "MoveRight" : "MoveLeft") 
                : (moveDirection.y > 0 ? "MoveUp" : "MoveDown");

            anim.SetTrigger(direction); // pt. animatii
        }
    }
}

Your setup is saying that every frame that IsMoving is true and the MoveUp trigger is set, you should transition from the current state to the walk_up state. This includes from the walk_up state, so it’s transitioning to the start of the animation on every frame.

One thing you need to to is to turn CanTransitionToSelf off on that transition, as you probably never want to transition from a move animation to itself.

You should also stop using triggers for the directions, as those will have to be consumed by the animator before they’re cleared. From your screenshot, MoveDown, Right and Left are all set, so once you add the other transitions things will be a mess.

The CanTransitionToSelf was the thing that ruined it. Also I will look to not use triggers in the future and also use Blend Tree, but for now this is fine. Thank you.