Gun Reloading Animation Fails to "Find State"

Hi there!
Recently I have been working on a small project just to see if I can can a gun model I have attached to a default Character Controller to both shoot and reload using an animation. I have all the animations I need, however when I use:

if (Input.GetKey(KeyCode.R))
		animation.Play("MachineGun_reload", PlayMode.StopAll); 

in-game runtime, I get an error that the animation state “MachineGun_reload” cannot play because it cannot find it. What does this mean? I have an animation component attached to the Character Controller along with the animation name that i selected. Do need to reference it in some way? I have tried adding it to the animations list, but it still cannot either find the default animation or cannot play it cause it can’t find it.

Any help would be greatly appreciated. Thanks,

Click on your animation file in the Unity Project Pane tab, and on the side the Inspector should be there, right click on the Inspector tab and select Debug.
Once you’re there, simply change the animation type from 2 to 1.


In Unity 4.6 Animation Tyoe is a drop list, not a number?

We use Humanoid.

We get a problem where every time we build it appears to randomly do or not do the animations.

We see the error that the state is not found. This only happens in the built .exe, in the editor it works fine (usualy).