- Home /
The animation state could not be played because it couldn't be found!
Hi,
So, I have a few animations that get triggered based on if/else statements, but I always get messages like, "The animation state attack could not be played because it couldn't be found!" Please attach an animation clip with the name 'attack' or call this function only for existing animations. UnityEngine.Animation:CrossFade(String)
Here is an example of code:
if(distance < pursueDistance)
{
animation.CrossFade("walk");
}
I don't understand what the problem is. I deleted the animations and reloaded them, but that didn't help. Any ideas on how to fix this would be appreciated.
Thank you!
Answer by winermustang · May 29, 2014 at 02:17 PM
I have this problem , and i think i find the solution . select your player , then in the inspector area clik on "select" and know clik on "Rig" and in the Animation type choose "Legacy ". for me that work hope it will work for you PS.exuse me for my english (i am french)
Answer by PAEvenson · Dec 27, 2012 at 08:45 PM
First, make sure the "walk" clip is in the animation array in the inspector. Next, confirm the animation name. I believe it is case sensitive. Following that, make sure the script is attached to the gameObject with the animations. Hope this helps...
Answer by lst · Dec 13, 2014 at 05:14 PM
Must select "Legacy" at character fbx and at animations fbx
Answer by SohailBukhari · Sep 29, 2019 at 09:21 AM
Correct answer here
https://answers.unity.com/questions/584106/the-animation-state-could-not-be-played-because-it-1.html