- Home /
Animation not be found
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;
}
Answer by casteponters · Mar 12, 2015 at 01:09 PM
I solved the problem.
Select animation -> right click on inspector tab and select Debug -> set animation type to 1.
Your answer
Follow this Question
Related Questions
Animation doesn't play 1 Answer
Running animation 1 Answer
On Hit play animation 0 Answers
How to make a transition animation, intermediate animation between two main states 0 Answers
Unity 5 Broken Animations? 3 Answers