What is the difference between grey and blue prefab ?

Hello everyone.

I have a question about the display of the instanciated prefabs into the hierarchy window.

If I drag and drop a prefab in the project explorer into the scene, it is colored in blue. But, when i do that in script, the prefabs are named myPrefab (Clone) but colored in grey.

UnityEngine.GameObject NewPrefab = (GameObject)Instantiate(myPrefabList[rdChoice], newPos, Quaternion.identity);

Does that means I loose the instanciation ? What is the meaning of the blue color ?

1 Answer

1

The blue color means it is still linked to the prefab--thus if you change something on the prefab object in the project, all of the blue copies of that will also change. If it is colored grey, it is 'broken' from the prefab and controls its own set of components and variables.

I believe that Instantiation doesn't link the cloned object back to the prefab because it is intended to be used while the game is running, where prefabs don't matter as much.

Do you know how create blue prefab in script? I can't do it with Instantiate() function

–

Same Question. Is there a way to "instantiate" a Blue prefab?

–