prefab query

when i add some properties(Script) to the gameObject and make its prefab. so here my prefab dont execute according to the provided script but my gameobject does work according to the script?

1 Answer

1

Prefab are like models. They only exists as ‘resources’.

In a scene, you use an instance of a prefab, i.e. an object that follows the model. This object will ‘execute’ the scripts and components attached to it.

Modifying a prefab, implies modifying the models all instances follow. Therefore addind/removing or modifying a property in a prefab will also impact all instances. The only exception is when instance override the value of a property (this override is displayed in the inspector with a bold font).

You can learn more about it by reading the documentation: http://unity3d.com/support/documentation/Manual/Prefabs.html