The plan is to start simple, so a few different hair styles, skin tones, shirt colors, etc. and then generate a few random numbers that’ll decide which attributes are chosen. These will be 2D sprites, so it feels like I’ll need to make (and animate) a 2D sprite for every possible variation?
I feel like there should be an easier way to create a random character, but have no clue where to begin. Any advice?
One approach: Make all your assets in greyscale and colorize them in unity.
If you want more than one color per image you can either split your graphics into multiple sprites or use a shader to colorize based on channel data or do a combination of both.
Definitely don’t make a sprite for every combination. Make sprites for the individual pieces (like hair) and combine them at runtime by rendering them in appropriate relative positions.
For elementary stuff, you can just have multiple objects with Image components that are all children of a single object so that they move together.
For more advanced stuff, I believe Unity’s got a couple of tools designed for animating multiple sprites together, but I don’t have enough experience with them to be much more specific than that. You can probably find tutorials covering this if you look around.
As geo_ mentioned, you can also take advantage of sprite tinting to get multiple colors out of a single asset. Remember that the tint color multiplies with the base color, so a pure white asset changes into the selected color, and anything other than white will darken the tint color.
Having made a few character customizers and randomizers in my time, let me warn you this is one of the fiddliest most annoying and least rewarding programming exercises ever.
I understand that some designers think this is a critical feature for certain game types in order to enable the FRP player to “get into” their character, but just beware what you are getting into.
And it never stops: every piece of stuff and feature you add interacts and gets in the way of every previous one.
Character customization / randomization is a friggin’ nightmare.
Thank y’all for the advice! It definitely helped me to narrow down my search and I’ve found some super helpful YouTube videos. What I’ll probably end up doing is split the characters up into multiple sprites like you mentioned above. Thank you!