Search Unity

Question Animation not replaying with Animator.Play

Discussion in 'Animation' started by Phoenix248, Apr 2, 2023.

  1. Phoenix248

    Phoenix248

    Joined:
    Sep 20, 2019
    Posts:
    52
    Hi everyone!

    I have a non-looping animation called "Attack_Ground" that plays when the following method is called:
    ]
    Code (CSharp):
    1. public override void OnEnter()
    2.     {
    3.         character.characterAnimator.Play("Attack_Ground");
    4.      }
    If the animator is playing another animation and the method is called, it will play "Attack_Ground" normally. The problem is that if "Attack_Ground" is currently playing, it will not replay the animation.

    So, how could i replay this animation without having to switch to another animation by code?