Having had a thorough read-thru of the communities questions on the forum, I'm still having some difficulties understanding the method of animating a multi-sprite character in AC. I'm getting the "cannot play animation clip [name] on [character]" error in the console during gameplay, and I'm hoping with some of these queries answered I can find a way around it.
- The character's sprite child (in this case their body) is the parent of the other sprites that make up the character, and the animator is placed on this game object, so it can control the sprites lower on the hierarchy. Is this correct?
- The character I'm creating has custom facings (just two, L & R) and flipping on. Are the animations shown in "list expected animations" the only animations I need to create and add to the controller, or do I need to add all other (unused) directions too?
- Regarding naming conventions of animations, I understand that I don't add the [direction] in the inspector, but is AC looking for [character's name][animation name][direction] or just [animation name][direction]?
Comments
Thanks Chris - I'm going to check everything over once more, but right now I have no idea why I'm getting the "cannot play animation" error.
Am I correct in saying that AC should handle switching an NPC from idle to walk when (for example) a character move to point action sets them moving?
Their Animation engine field is set to Sprites Unity, right? Then yes, animation playback should be automatic - simply having animations with the correct naming convention present in your Animator Controller's base layer should be enough.
Feel free to share screens of their Inspector + Controller window if you want another set of eyes on it.
The animator window, hierarchy and inspector for the character and sprite child are here:
https://imgur.com/a/d6PDqDv
That extra set of eyes most appreciated!
Yeah, you need to add directional suffixes to your animations in the Animator window.
Currently, you have two: SteveIdle and SteveWalk. But these have no associated direction. Just rename these to SteveIdle_L and SteveWalk_L, as shown in the "List expected animations" foldout and they should play.
A-ha! It works!
It's always something obvious in the end ... For anyone following along in this thread, somehow the _direction on my animations was not present in the animator window (even though the animation clips do have the directions in them), and simply clicking on the animator boxes and adding the suffix fixed it.
Thanks ever so much for all your help Chris.