Animation not running

The animation on my prefab stopped working.

Here is my testing code.

public void Awake()
{
    _animation.Play(MyClip.name);
}

public void DebugLine()
{
    Debug.Log("Hello");
}

The “DebugLine” method is called from the animation. This method is not called. The animation does not execute. No exceptions or errors are raised. Other animations work, im totally confused.

Edit :
I tried running the animation from a coroutine.

IEnumerator Animate()
{
    Debug.Log("Animate");
    yield return 1;
    _animation.Play(MyClip.name);
}

That didnt work either.

Edit 2 : This bug gets weirder and weirder. The animation is now playing, but, it is the wrong animation. It is playing MyOtherClip when it should be playing MyClip.

Edit 3 : I got the correct clip to run via this hack

IEnumerator Animate()

{
Debug.Log(“Animate”);
yield return 1;
_animation.Play(MyClip.name);
yield return 1;
_animation.Play(MyClip.name);
yield return 1;
_animation.Play(MyClip.name);
}

What the hell is this ?

You’ve got a _ before animation.Play. Also, you should use animation.CrossFade("MyClip, 5); it makes it smoother and you can change the number 5 to anything you like.