Hey guys, super simple question about animating, layers, and sprites:
I have an angel whose hair flows in a loop and arms that operate based on abilities she uses. I’ve been trying to get both animations to operate in one animator by having them in separate layers but only one sprite is ever shown at a time: that is, hair without arms, or arms without hair.
I’m using sprites, a sprite renderer, one animator, multiple layers with individual animations running off of some of the same parameters but not all the same.
Sorry this is such a basic question but i couldn’t find any tutorials or answers online.
I had the exact same problem, I just used more than one animator tbh.
Disclaimer that I’m not sure its the best solution, but basically what I did was have a character with different body parts as game objects (so one would be ‘hair’ one would be ‘body’ and one would be ‘arms’ for you. or as many layers as you need. I did armor, front arm, back arm, and body).
then each child of the parent game object (so each body part child) has its own animator. and to the parent you attach an ‘animator proxy’ script, or whatever you would call it, so you can deal with changing the animations in code easier… So that when you have to update the animator you call the function on the animator proxy and it updates the animations for you. Instead of having to update each animator manually every time.
I’m not 100% sure the last step will be necessary for you, I’d need to know more about your project. I did multiple layers within each animator and multiple animators, so i could have different armors/ weapons. But if you just want the angel to have the same armor /weapons it may work without an animator proxy script.
either way. sorry if this was confusing. let me know if you want to see my set up or my animator proxy script.
gasp oh, nice!
Kinda seems like a hassle. Hopefully some unity wizard comes by and has the perfect solution but for now I think I can get that to work. Thanks for the idea!
Not sure if I fully understand the issue, but if you would like to swap out Sprites in your SpriteRenderers, have a look at our SpriteSwap feature in the 2D Animation package.