Unity 101 :) Prefab

Every time I make a Prefab and spread it all over my scene then try to add a new script to one of the Prefab’s it is stating that the connection to prefab is going to break… What am I doing wrong. How do I add one script to all of my prefabs at the same time.

Should we have a Newbie Section so that more advanced issues could be separated from more basic ones? Just brainstorming…

The “problem” here is that you’re doing the following:

  • Making a prefab
  • Dragging an instance of the prefab into your scene
  • Modifying an instance of the prefab

When you do that last modification step the error is correct, you’re changing an instance and not the source thus “breaking” the connection. The trick here is that you want the source prefab to be modified and that’s easily handled. Just add the following steps:

  • Dismiss the error message by clicking Continue
  • Configure the newly attached script as needed
  • When done, leave the modified instance selected and go to Game Object > Apply Changes to Prefab…

Done! That will push that instance modification on to the source prefab and thus all instances will now have that script attached. :slight_smile:

THANK YOU SO MUCH!
That makes sense…

I like to drag the updated instance back onto the prefab myself. :slight_smile: Same effect.