How to make a non-human character customization screen?

The good news is: This is super easy!

You have to make friends with “Material Instance Dynamic” (MID for short)

First, make a Material. For each texture you want to be able to swap, make that a texture parameter. For each color you want to be able to adjust, make that a color (vector3 or vector4) parameter. Give the parameters easy-to-arrange names – like “Normal0,” “Normal1,” “Markings0,” “Markings1,” “Markings2,” “Color0,” …

Create an object or struct type that contains the appropriate asset kinds – texture references, and color values. The point of this is to store the values, and it should have a function to “apply yourself to a material” that sets each parameter by name as appropriate.

Finally, in your character setup, you get a copy of the material in question, you call “make dynamic instance” on that material, you take the parameters of one of those objects and apply to this material instance, and you configure the material instance as the material to use for the animated mesh.

You could even give your player character an instance of this object that stores the values. It could be an actor component maybe, to make it easy to manage.

In your GUI, make sliders and buttons to change each of the parameters in this kind of parameter-storage object. When the user changes some parameter, update the value in the object, and re-apply the values of the object to the parameters of the material that’s on the mesh.

1 Like