Wardrobe Changes for 2D Sprite

I have hand drawn characters on sprite sheets. (Not a parts atlas.) I have run, idle, jump and climb animations to name a few. My main character starts off wearing his ‘base class’ clothing. What I want to do is allow him to change classes and in doing so, his appearance would change.

Does anyone have suggestions for how I could do this, as I’ve looked and keep finding 3D help only. I would love to have any suggestions or links to tutorials.

Because the animation is hand drawn, and I am taking each frame from a sprite sheet, I don’t know if it is best just to make an animation over-ride controller and add in the new frames for every animation, so that his walk(ect.) will literally be replaced with a new sprite animation per state. OR, is there a way to give each individual sprite within an animation a layer that is like a coat?

Then finally, I want each class, like warrior, to exclusively have access to a few animations. A warrior will only be able to access the sword attack, while a mage can only access the casting spell. Again, any tutorials and suggestions for how to do this is greatly appreciated.

1 Like

If you change the whole sprite when swapping clothes then you can go by swapping set of animations, like you have a set of movemnts with armor and nother without. This for each armor.

If instead you want to be able to equip parts of clothing, like for example only the helmet, I would suggest to make those separate animated parts.

For example you have the base character, add new pants, instead of animating the whole character with pants on you put a new animated sprite on top of the character with just the pants animated and so the same for the other parts. A game example is Baldur’s Gate, armors are overlapped sprites that animates with the character but in reality are a different set of sprites, this to save an almost infinite set of character sheets for each combination.

As for the rest really depends on how you want to approach it, for having a particular class to wear certain items you will have to set the items to have a list of forbidden classes, then you check if your class is in that list and if is he case proceed as you want.

2 Likes

I think I get what you are saying for ‘animate sprites on top of characters’. Essentially, instead of using the override controller, I would be getting into layers? Is this correct? I need to make a layer on top my base class, and the outfit is basically what appears over the base sprite.
So I might make some pants and a hat for a warrior class, then add a new layer to the Animator Controller, and then when the warrior class becomes active, that layer becomes active? Please tell me if this is correct.

EDIT: Ok, I talked to the artist, and this is what we would like to do. We wanted to either extend the original controller, or make some kind of mask that allows for a sprite override. Can I use one controller and masks, or should I go back to trying the animator override.

*Remember, I am not using Spline or Spriter or parts of a character. I am using frame by frame animation (from a sprite sheet) and the base sprite is on the same layer. I’m not wanting to do puppet animation or break up the pieces, due to the movement mechanics of the game. I want my character to be able to wear something simple, like a sash or boots, to signify a class change. Not equip different pieces of armor throughout the game.

1 Like

I left the above message, in case anyone has any other suggestions, but I think I figured it out, thanks to Neurological. I haven’t tested it yet, but I went into my MainAnimatorController and made a new layer. Then, I checked Sync!
My tree structure from the base layer comes up, AND I can now add in all new animations. Since my animations are essentially just the same sprites and cycles with graphical changes, I can just make new animations.
This is actually the best route for me I think since I am not using body parts, and importing one whole sprite per frame.
Now the next step will be accessing and using that layer mask exclusively for the associated class, and restricting access when not that class.
Again, any tutorials or helpful guides or advice is very useful.
Thanks!

1 Like

Yeah if you just have to change the whole character, is best to just add new sheets with animated clothes, no need for the other method for parts.

Honestly I don’t use mecanim for sprite animations because is a bit too much for it, just wrote my own system that goes trough a series of sprite rects and apply, but I don’t neeed anything else so it may not be the case for you. Can give an example with the game I’m working on.

I have the main character that can select different weapons, each weapon have a different stance animation for when moving and idling in place, so I gave to each weapon class an index, when I switch weapon I apply the index to a List of animations, if index 0 play animations at List count 0 and so on. Maybe trough mechanim you can do the same with states, honestly no idea how would you go with that.

1 Like

Your not the first person to tell me that. I have only been using Unity for a little over a year, so I started learning a few months before there was a Mecanim system. For this reason, I have always taken advantage of mecanim and only when there is one instance of animation, such as automated or very minimal script control, do I control movement through script. I essentially script sparsely when using mecanim and let it handle a lot for me.
I would be interested if switching to an array through script is better, and keeping more organized. What you said makes sense.

1 Like

I guess is about preference, if you are used to it and know how to work with Mecanim is perfectly fine, I honestly never got much into it as I prefer a more script approach plus I need just one small thing out of an animation system. I was also kinda forced to do my own thing as I read from external files after build and Mecanim doesn’t give me much freedom at runtime.

But mind that my method isn’t better than your, is just different. As long it suit your needs is fine. I’m just sorry that I can’t give more precise direction to set up thing like that in Mecanim as I don’t know much how to work with it.