So I have a prefab gameobject called “orbinstance” of which there are hundreds in my scene. When I was first making the game, I made a second version of this prefab that is nearly identical except for its scale called “orbinstanceSecond” for the sake of the scene hiearchy, and long story short this turned out to be an unwise decision. I now have hundreds of hand-placed orbinstanceSeconds is my scene that I would like to change to orbinstances without altering their position. Is there any way to do this besides copy-pasting transforms onto new orbinstances and deleting the corresponding orbinstanceSeconds one by one? Some sort multi-object transform transferal? Any advice is appreciated.
1 Like
Write a script to do it. You can either create an editor script, (or just a normal one and set it to execute in editor). Just do a find for the object copy the values and instantiate the new one. Then either destroy the original one via script, or just find them in the hierarchy and delete them.
How do you run a script on the editor exactly? Like a script that operates outside of playmode?
Here: Unity - Scripting API: ExecuteInEditMode
Just be careful, duplicate your scene first in case something goes wrong.
1 Like