- Home /
Reverting to prefab-state several game objects at once with stock Unity
Hey guys, I need to revert several similar objects to their prefab at once but when I select said objects I can only revert last selected.
This issue seems to be a part of a pervasive problem with Unity whereby if several objects are selected you cannot make changes to all of them(Say remove a component that they all share).
Any ideas would be greatly appreciated, since this issue has bugged me ever since I started working with Unity.
Thanks!
Answer by roamcel · Aug 24, 2011 at 03:24 PM
Since you seem to be talking about editor mode strictly, the only simple way in which you can achieve something similar is by creating a different prefab for each 'class' of your gameobjects in the scene, and then alter the PREFAB attributes for each group, rather than the scene objects.
I don't think there's many occasions in which this could be an issue though. You usually don't need to revert scene objects to prefab, unless you're experimenting with the editor, possibly. As a matter of fact, in this case you could be better off actually going for editor scripting.
That's quite true, and while I try to keep myself from editing a prefab-connected-object so as not to break the connection at times it either happens by accident or due to a crash.
But it is a bit counter-intuitive and dreary since I need to create a prefab for each lamp as an example.
Answer by DaveA · Aug 24, 2011 at 03:31 PM
Give this a try: http://www.unifycommunity.com/wiki/index.php?title=ReplaceSelection I think it will do what you need.
Answer by Stardog · Dec 28, 2011 at 12:27 PM
Here is a solution: http://answers.unity3d.com/questions/144453/reverting-several-gameobjects-to-prefab-settings-a.html
Old question, but it's high up on Google, so I'm linking to the solution.