- Home /
Best way to render a character with extra accessories?
Which of the following approach is better for using a character with a hat in your game?
Approach 1:
I create two separate models: one with the hat, and the other without the hat. Note, the first model with the hat is rendered as a single mesh, meaning the hat is part of the character and cannot be taken off.
In game, when the character needs his hat, I'll load the one with the hat, and vice versa.
Approach 2:
I create one model, with two meshes, the body and the hat. In game, when the character needs his hat, I'll toggle the "Mesh Renderer" of the hat mesh, so the hat will only be rendered when needed.
Answer by Owen-Reynolds · Jan 26, 2012 at 04:13 AM
The more common approach is probably to make the hat as a separate mesh. Put an empty mountPoint on top of the head. Spawn there and child to the head bone.
Advantages are you can swap out hats, put the same hat on different people, or on a hat rack.
In theory, two meshes draw a little slower than 1. But, if you were planning on using a different material for the hat, it counts as two meshes anyway.
DUDE!!!! I could kiss you right now!!! (No homo). $$anonymous$$y days of headache just got thrown out of the window because of you! Thanks!
Your answer
Follow this Question
Related Questions
What's the best way to optimise thousands of instances of the same mesh? 2 Answers
Reusing assets / performance question 0 Answers
How do I properly save a procedurally created mesh? 1 Answer
Replace GameObject vs. replacing mesh and material? 2 Answers
UnityException: Creating asset at path /blabla.asset failed 0 Answers