Hello! I am super new to game dev and Unity. I was wondering if there’s a way to have ‘layers’ essentially to a sprite. Like a way where multiple images can be compiled together in one sprite.
This is the example I made. In the top image, the lineart, base color, white, and eyes are all in one image. I would rather do the second example, where four images layer together to make one image. I don’t know if this makes any sense but any help would be appreciated.
put each body part to its own gameobject with a sprite renderer component(easiest to implement). You might need to use sorting group component to make sure the final result acts like a single sprite so to speak
use a shader to change the color of specific parts. In the shader version, you’ll just have a mask for each section(eyes, line art, brown fur etc.) and (exposed) color for each section which you’ll use to multiply the mask with the color to get the final result(has a lot of customizability with much less memory, more performant than the first option, less run-time performant than the third option, this can give your players ability to create their own designs etc.)
There are also other alternatives like actually creating a new texture out of the given sections and just put them on top of one another(overwrite the resulting texture’s color if alpha>0) and using that new texture with a sprite & sprite renderer(fastest runtime performance because you end up having a single sprite renderer on a single gameobject, can create a fps drop when creating the new texture if you have large textures and dont use compute shaders to find the resulting texture’s colors)
You can also combine second and third options to decrease disk space and give your players the ability to customize their designs while being the most performant
I’d just go for the first option, it doesn’t require any extra setup/coding and you most likely won’t notice a performance drop.