- Home /
Modifying just one mesh and not all instances?
It seems like procedural modifications of .sharedMesh would modify all instances of the same gameobject. Is there a way to modify just one mesh and not all?
Answer by Paulius-Liekis · May 02, 2012 at 08:45 AM
Clone sharedMesh, modify it and assign to mesh property.
Answer by alwynd · Oct 13, 2013 at 03:11 PM
Hi, you should be able to simply clone the sharedmesh, and assign it back to the sharedmesh property, because the skinnedmeshrenderer is not instanced, the code should work.
myRenderer.sharedMesh = (Mesh) Instantiate( myRenderer.sharedMesh );
no need to set individual properties, that's just silly.. my mistake.
This way, the sharedmesh itself is a clone, but not an instance, and any changes you make to the vertices for eg. morphing, will not affect the original.