Hi all,
i’m a new entry with animation.
But i create new animation called “destroybox”.
I need to call this animation when click on the object box.
But not work and return this error:
The animation state destroybox could not be played because it couldn’t be found!
Please attach an animation clip with the name ‘destroybox’ or call this function only for existing animations.
this is my animation
and this is the animation attached at box object
and this is my code:
if (hit.collider.gameObject.tag == "Box")
{
hit.collider.gameObject.animation.Play("destroybox");
//Destroy(GameObject.Find(hit.collider.gameObject.name));
//BoxCount -= 1;
}