- Home /
The animation state right could not be played because it couldn't be found!
I have created animations with Unitys built in animation tools and assigned them into the instructor panel as animation element 0 and 1. The animations play and behave properly, so when object hits a wall its animation changes. But I get a console error that the animation state could not be found. Its not crashing the game but it is annoying me.
if(Physics.Raycast(transform.position, Vector3.right, hit, 5)){
if (hit.collider.gameObject.tag == "Wall"){
if (direction == 0){
animation.Play("left");
direction = 1;
}
}
}
if(Physics.Raycast(transform.position, -Vector3.right, hit, 5)){
if (hit.collider.gameObject.tag == "Wall"){
if (direction == 1){
animation.Play("right");
direction = 0;
}
}
}
Comment
Your answer
Follow this Question
Related Questions
Help playing the right animation 1 Answer
Mechanim state triggers twice 1 Answer
Can the animation editor create local rotational data? 3 Answers
Is it possible to make empty, passing state in mecanim? 3 Answers
Adding animation clips via script 2 Answers