Destructible characters

I’m working on having some enemies that change their mesh when damaged, and I’m posting my theory on how to most efficiently do this in the hopes of getting some ideas from others. I’m not entirely convinced I’m going about this in the most economical way, and if anybody happens to read this and think “dear god, that’s going to kill your framerate” then I’d love to hear it :-).

Basically I have an insectoid creature that is covered in a series of armor plates. In my maya file, I plan to have most of these plates be seperate meshes, along with ‘broken’ versions that start invisible in unity, and are toggled on as needed when damage occurs. I know that ideally a character should be one material and one continous mesh, but obviously that’s not an option here. Essentially what I’ll have is several meshes all sharing one material and bound to the same skeleton, with their renderer being activated/deactivated via scripting.

Does this sound like a reasonable solution? Will having 10-12 pieces of geo all bound to one skeleton and using the same material have much of an adverse effect on performance? And is there any advantage to having them share a material, or would a dozen seperate materials have the same cost in the end?

The same material would be better. You can also do a mesh-join on the fly. Check when the figure is hit, assemble the new figure from invisible parts, then join it again. At least that is, what a friend of mine and i figured out to be best for performance.

Instead of turning on and off objects, would swapping the armor mesh maybe be faster? You would have less objects in your scene, but I dont know if swapping the mesh would cause a hiccup.

Just my thoughts.

Bill