Forum rules - please read before posting.

Multi-sprite animations and Animations Sprites Unity ("cannot play animation clip" errors)

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.

  1. 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?
  2. 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?
  3. 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

    1. Yes. Though this is handled by Unity, an animation clip can be used to affect properties of child objects.
    2. The "List expected animations" foldout should list all animations necessary for the character's standard behaviour, i.e. walking, idling, talking.
    3. Just [animation name][direction]. If your "Walk animation" field is set to "walk", their right-facing name will be "walk_R". You can drop the 2D Demo's Player prefab, Brain2D, into the scene for a guided example.
  • 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!

  • edited April 2020

    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.

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.