- Home /
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, Whutchison
Answer by smileteam · Sep 06, 2014 at 09:00 AM
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.
:P, smileteam
Thanks a lot! I would have never known about the debug tab without this!
Answer by RKSandswept · Sep 18, 2014 at 06:17 PM
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).
Your answer
Follow this Question
Related Questions
Animation not looping 1 Answer
Parameterized Animation Clip 0 Answers
Mirroring animation clip without mirroring root motion node? 0 Answers
Animator Override Controller changed at runtime doesn't always play the animations correctly 1 Answer
Why does my transition freeze the second animation on it's first frame? 1 Answer