|
hi, i got an game object with components & scripts attached to it. if the player clicks on a gui button the engine needs to destroy the current object and load a new object with the same component scripts settings position etc. (like a swap of objects) this is what i got
greetz
(comments are locked)
|
|
Perhaps you could just use Instantiate to create the new object, then destroy the old object. Eg: IIRC Instantiate doesnt copy the renderer values so you might have to rehash those as well, all the times I have used it then tried to change the r,g,b,a values I got 'renderer is not attached to this object' where it was in the original.
Jul 03 '12 at 11:00 AM
EdzUp[GD]
(comments are locked)
|
|
If the settings are always the same, just instantiate a prefab. If not, then write a method which will copy all the values (like position, mass etc.) from one object to another.
(comments are locked)
|
