Forum rules - please read before posting.

Animator.GotoState: State could not be found

Hey Chris,

I'm making a 2D game where I need very few animations (walk left and right, idle down, left and right - mono-color character on a sidescroller plane).  Because of this, I don't need to add animations for walking up or down.  

I'm receiving an error (Animator.GotoState: State could not be found) when walking, but the character animation is working as desired.  I've found a few other threads where the issue was with having Multiple Directions unchecked, but I'm using the _L suffixes and the animation only works with this checked.  I'm using Sprites Unity.  

Is the problem coming from me not using all of the preferred animations for Walk and Idle?  

Any help is appreciated.  Thanks in advance.

Comments

  • Try putting the NPC Component on it
  • This error occurs because when using multiple directions the game looks for animations for ALL directions, regardless of whether you need them or not. If it can't find one, it throws that error.

    What you want to do is add a new node in the Animator for each of the missing animations, and just drag an existing animation into it. So if you only made a Walk_L animation, make an empty node for the other three directions, then drag the Walk_L clip into them, so they all use the same one. That will stop the error appearing.

    You only need to do this for up, down, left, and right. And you only really need to make one sideways animation clip, because you can have left mirror right (or the other way around).
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.