I have an application that allows a user disassemble and reassemble components - like an engine. When I manually disassemble things, the copying works fine and I don’t have any material issues. When I automatically disassemble things - using the same scripts that are used for the manual process, it may or may not instance the material and when it does instance the material, it has the right name, but the material itself incorrect - so the color might turn out white or red instead of what it’s supposed to be. I’m not using a texture atlas, and I don’t copy the material and apply it to the copy. The original objects use the standard shader, set to opaque, just the color. Code is pretty simple:
GameObject copy;
copy = (GameObject)Instantiate (actualTransform.gameObject, actualTransform.position, actualTransform.rotation);
The problem is consistent and the same parts always end up being the wrong color.
Any ideas?
Thanks!
Rein D