- Home /
Animating 2D Character made up of 2 or more swapable sprites
My player character for my game is made up of 2-3 sprites that will be exchangeable (Head, Body, Weapon) There will be several weapons, heads, and bodies but only one of each active at a time. Currently I have this achieved by a player object with a body and head object parented to the player with the animators setup exactly the same.
All 3 objects will have the same number of animations and such and are easily stacked on top of each other. I only have one of each implemented but remaking the animators for each new object or making changes later seems inefficient.
My question is: Is there a way to use one animator to animate different sets of sprites. Like is there a way for an animation clip to have several sprites layered with which I could show/hide? Or maybe having the animation clips for each head, body, ect in an array and replace the ones in the animator when changing but keeping the transitions? Thx
Go to Create > Animator Override Controller. Drag and drop the controller you want to override and it will load up all the animation clips the animator uses. You can then drop in any animation clips you want to override. Otherwise the original is used.
Answer by Manaflow · Jun 22, 2014 at 09:06 AM
Found a solution that works. The override controller allows different objects to reference the same animator but override the animation clips with a different set. Any clip not overwritten will play the original clip.