Customizing clothes, hair, etc. for pixelated 2D characters

Hi there! I’m working on a top-down 2D RPG with a pixelated look and I wanted to have an outfit and hair system similar to something like Stardew Valley or Terraria.

I’ve seen several resources on how to animate different elements with skeletal animation in Unity to make swapping out parts a lot easier, but I just don’t think that will really look good with the pixelated look so I’m wondering what my alternatives are.

Right now I’m working on basically making an animation sprite sheet for each piece that can be changed, so each hair style will have it’s own sprite sheet for example. This means that each body part that could be changed will have it’s own animator in Unity though.

This isn’t that bad, my animations aren’t so complex that it’s unreasonable to do, I’m basically just copying motions anyway at this point, but I’m wondering if there’s any other techniques to do this.

it will be bad if you have many characters like that on screen

use texture2d.setpixels to merge all parts into 1 sprite and then you need only 1 animator. ( also you only create the combinations that the characters are using at the moment so you save memory even though there can be trillion combinations)

So I’m only trying to do this for the player character. I want to give the option for the player to change their hair or their shirts, skin colors, etc.

Not familiar with the setpixels method, I’ll look into it. Hopefully what I’m trying to do makes sense haha

basically you use texture2d.setpixels to merge all layers into 1. So you can have only 1 sprite by combining every individual customization part.

instead of having hair layer, shirt layer, skin layer, boots layer, pants layer

you have 1 layer that has all merged hair+shirt+skin+boots+pants in 1 sprite

1 Like

Makes sense, but in the event that I want to swap out for a different hair or change the hair color for example, does it separate again? Or do I need to rebuild the whole sprite from scratch then?

you just unload it and load the new one( with the different customization) you can even use texture2d.setpixels to paint the pixels different colors so you dont need to have extra .png of parts if only the color changes