0
\$\begingroup\$

I have some doors in the scene, each door at another position. I took one of the doors added to it a light and made a prefab of the door.

Now I want to replace all the other doors with the prefab.

Example of the door with the light I added and this door is also a prefab:

Door with light prefab

And this is example of another door that is not yet replaced by the prefab door with the light:

Door

I want to replace this door with the prefab door with the light at the first screenshot. The question is if there is a easy way to do the replace ?

I have more doors that I want to replace.

\$\endgroup\$
  • \$\begingroup\$ Can you drag your new door over the old prefab to overwrite it? Or does that break existing references? \$\endgroup\$ – DMGregory Aug 5 '18 at 21:01
  • \$\begingroup\$ @DMGregory It's not breaking the existing references but it's not placing the prefab in the same position and rotation like the existing door that I want to replace. \$\endgroup\$ – Benzi Avrumi Aug 5 '18 at 21:33
  • \$\begingroup\$ Do both the original prefab and the new replacement have the same orientation and pivot? \$\endgroup\$ – DMGregory Aug 5 '18 at 21:36
3
\$\begingroup\$

Is there already an prefab for your door without the light? Then you simply have to add the light to this prefab in the scene and click on apply at the right top inside the inspector. This would normally update all objects inside your scene. If you don't have a prefab, add a light to the door without a light with the attributes you want, drag and drop the door into your prefab folder.

Take each door, that doesn't have light, click on the small symbol inside the inspector at the tansform component and choose 'copy component values' (its right at the top at each component, looks like a small gear symbol). Drag and drop your prefab with the light inside the scene and click on the symbol inside the inspector once again but this time, click on 'paste component values'. This should put the prefab exacty at the position where your 'old' door is located. Delete the door without the lighting of course afterwards.

If you also want doors without the lighting, make sure to have a prefab for this as well, otherwise if you change something inside the prefab (deleting the light for example), all prefab copies inside your scene will lose the lighting as well!

Greetings!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.