Search Unity

Sprite animation does not play - Animator plays proper animation

Discussion in 'Animation' started by FreddyNewton, Sep 30, 2020.

  1. FreddyNewton

    FreddyNewton

    Joined:
    Oct 23, 2018
    Posts:
    6
    Maybe someone can help me?
    I use an attempt to work with Animator but without transitions between the animation states but solving everything via code with this little snippet:

    Code (CSharp):
    1.  
    2. public void changeAnimationState (string newState) {
    3.         // prevent current animation interruption
    4.         if (currentState == newState) return;
    5.  
    6.         // play the invoked animation
    7.         animator.Play(newState);
    8.  
    9.         // set string to current animation as a monitor
    10.         currentState = newState;
    11.     }
    12.  
    It also works for everything else e.g. sword etc. but not for the skeleton. Somehow the sprite does not change in the game. The animator plays the correct animation state, the sprite renderer always has new sprites. But nothing moves in the game.



    Also the animations are exported correctly:



    Maybe someone can help me? Because I never had anything like this before
     

    Attached Files:

  2. FreddyNewton

    FreddyNewton

    Joined:
    Oct 23, 2018
    Posts:
    6
    Solution: Changing back from URP to SRP.