As we finish up our work on the Wardrobe this month, our Lead Artist (DeRose) has been working on supporting the highly-requested hat + hair feature!
This is a prototype that we're still figuring out and setting up manually for many hairstyles and hats.
The system works by defining a range of default hat shapes in the game. Currently, we support around 4-5 hat shapes. These shapes are then referenced on each hairstyle mesh. We use separate shapekeys to deform the hairstyle to fit within these boundaries we've defined.
We've also coded in "special attributes", so we can easily set the hat shape in Unity. When certain hairstyles are worn with eligible hats, the hair will deform to match the shapekey associated with these numbers.
For example, the braided ponytail hairstyle has a hidden shapekey on the mesh in its fourth slot. Then, we turn on "Hat 04" for the Large Fedora head item. When the hair is worn together with the hat, the hat will sense that a matching shapekey exists and activate it.
Below is a photo of how the hairstyle looks when deformed to avoid clipping with certain hat shapes. Because that hat covers a part of Stuffy's head, you'll never see the hair clipping into Stuffy's head underneath it!
One issue is that some head items sit a bit too low and fall outside of the preset shape zones we've set. So, when wearing any compatible hairstyle, we now nudge some head items upward to avoid clipping with the hair and to better fit inside the zones.
This is obviously a very complex feature to navigate! We have loads of combinations possible, and not every hairstyle will support every hat or head cosmetic. Our main goal is to support this in as many obvious and useful combinations as possible, though some hairstyles that are taller or have accessories won't support this feature.
Since this process needs to be done manually for all hairstyles (and some work on nudging hats), it could take a while to integrate and maintain fully. You may also notice jiggle physics disabled on some assets to avoid clipping when worn together.
With all that said, this is still an amazing feature to add! Now you'll be able to style your stuffy in even more creative ways! :)