Instantiate a prefab at runtime

Instantiate a prefab at runtime give me a completely new copy of the original and it doesn’t share the materials.

That error has been through before the release of Unity 3.0 and it’s not fixed yet… I also load the prefab from resource folder and as long as it pass to another function, it always create a new instance different from original…

Prefabs are only an editor feature. At runtime there are no prefabs anymore. Only GameObjects! Those in your ressources folder aren’t visible but they are there. Instantiate will always just clone the given object. Every renderer has it’s own material instance. If you want to access the shared material use .sharedMaterial. That’s actually the one you assign in the inspector.

What you describe is not and have never been a bug / error.

“Modifying material will change the material for this object only.”

“Modifying sharedMaterial will change the appearance of all objects using this material, and change material settings that are stored in the project too.”

I think something wrong with that discussion. So what you basically mean is that the runtime instantiation will always create a new instance which doesn’t share the material information with the original right? Imagine that when you create 100 bullets while shooting inside the scene and if it will add additional 100 drawcalls which can greatly affect the performance…