Hi guys.
Building out my game and seem to be running into a problem. After building all my animations and loading them into my controller, when I test I get a ton of errors when moving downwards and upwards. The animation plays fine but the following errors prop up.
Animator.GotoState: State could not be found ; UnityEngine.ANimator:play (string, int32)
Any help? I am a n00b still :P
Comments
Is this only for moving up and down? rest are there ? i.e. left right are ok?
This error message sounds like the animation is not there for some reason. Which can be a few things, most of which are unity issues. Annoying I know.
Try looking at these:
a) make sure there is indeed an up and down animation. click sprite. Then animation window -> drop down list.
c) Still not working : try recreating the animations for these directions. Delete and redo.
d) look inside the animator that is attached to the sprite - select game object, double click the animator, and see what animations are in there - maybe you have multiple up's /down's.
e) Still no joy: remove the animator and create a new one, and drag all the animations in again.
I take that you have sprites with multiple directions yeah?
Hope one of these helps and is the issue.
Cheers
And some screenshots
Even if you don't have a down Idle animation, you still need to have a clip in your Mecanim controller named "Idle_D" (this can just be the e.g. Left Walk animation duplicated and re-named. Same goes for Idle_U.
However, this is not necessary if you instead switch to Sprites Unity Complex as your animation engine. With this mode, you instead control your animation using Mecanim parameters: you supply a walk speed, movement direction etc, and AC will control them and nothing else - allowing you to use them however you like, with no restriction on how many / few animations you want. For more on this mode, see section 3.9 of the Manual.
Ideas?
On another note, v1.49 will be more descriptive with the error: finally, it'll be able to tell you what animation it's looking for.
Good to know the new update will include such cool stuff, you are working really hard on this tool so bravo to you.
Regarding the other issue, the "Sprites Unity Complex" option was created for exactly that purpose. It allows you to animate your characters however you like - whether it be more complex, or more simple, than Sprites Unity is built for.