Forum rules - please read before posting.

Possible to have a second 2D sprite layer in an animation?

Hi. This may be more of a Unity question than an AC one, but I figure maybe worth asking.
I often would like to have an additional layer of animation for my 2D objects, eg I'd like the character to wear a hat at some point, and while I could make an entirely new set of walking and talking animations with the character wearing the hat baked into the sprites, what'd be cool is if I could simply have a 'hat' layer in the existing walking and talking animations, and turn it on and off realtime when appropriate.

Eg in the example below, I'd like to have a shadow for the character jumping around. While I could 'bake' the shadow into the character animation sprites, it would be great to have the animation also control a separate 'shadow' layer where I can position and animate the shadow according to what the character's doing:

I see another user has asked something similar in this thread, and it seems like it may be more a Unity issue, or at least, maybe more of a limitation with 'Sprites Unity' system, and maybe is possible with 'Sprites Unity Complex' or 'Mecanim'?

In any event, wondering if anyone knows of a way to get an animation to have more than 1 sprite layer in it? I've experimented by giving the character a child object that uses a different sprite but uses the same animation controller... no luck / weird results. It seems like the animation will only accept a single Sprite Rendered property. Thanks.

Comments

  • Your character's chosen "Animation engine" only affects the playback method of animations. The animations themelves are separate, and they can affect other sprites in the Hierarchy.

    An AnimationClip asset can animate the properties of any object that's a child of the Animator in the Hierarchy. This isn't AC-specific, just how Unity's animation system works.

    The other way you can control multiple sprites is to use a sub-layer in your Animator. For example, you could have a "Hat visibility" layer that simply switches between two animations that hide/show the hat sprite. For this, you'd probably want to switch over to Sprites Unity Complex mode and rely on parameters to control animation playback, but the use of layers and sub-sprite animations is still technically possible with Sprites Unity.

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.