- Home /
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?
Could you explain more clearly?
-Prefabs don't execute. They are instantiated as gameobject. What is exactly in your scene?
-When you say "i add some properties(Script)", do you mean "I attach a new script" or "I add new properties to the script"?
Answer by Kryptos · Apr 03, 2012 at 08:56 AM
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
Your answer
Follow this Question
Related Questions
Two exact objects behaving differently... *scratches head* 0 Answers
it is not possible to invoke an expression of type int 2 Answers
Creating Prefab causes scripts to break, Copy/Paste Gameobject doesn't 0 Answers
How to create GameObject without adding it to scene? 1 Answer
Acessing scripts in other game objects with prefabs, without using GameObject.Find 1 Answer