|
How can I change several objects in an scene from one to another? for instance lets suppose I have a ton of spheres and I want to change them all for cubes? and they are different objects? (not the same prefab)
(comments are locked)
|
|
Ok I finally figured this one by myself, so Im posting the answer for those who may be interested. Short answer: you cant, You cant replace an object that is already on the scene with another, you can fake it, and get a pretty similar result though. This is what you need to do 1.-Create a new prefab with the objects you want to "convert" from the scene (the cubes) lets call this "the list" 2.-Create another prefab with the final object you want to replace the originals(the sphere) lets call this "proxy" 3.-Now create an editor script that creates a new proxy in all the positions in the list (you can also copy other details like the script, textures etc)
4.-Delete all the original objects from the scene. Thats it. Is a bit of a laborious task but is better than modifying all objects by hand (specially if you have 800 like me, dont ask) I hope someone finds this useful. You might delete all the objects in the scene if they all have something in common by getting them by name or tag and putting them in an array. You can then iterate through the array and kill each one.
Apr 07 '10 at 05:38 PM
e.bonneville
(comments are locked)
|
|
Just made a blog post about the subject here http://zaxisgames.blogspot.com/2012/02/batch-replace-gameobjects-in-unity.html If I could upvote you, I would!
Aug 10 '12 at 08:01 AM
Bomadeno
Np, but great it could help you
Aug 10 '12 at 08:24 AM
KristianHJ
(comments are locked)
|
