|
I've got an object called board_new that was made from a prefab with the same name. I want to destroy the current instance and then instantiate another at a new location. Can somebody tell me how this is done? There will only be one board_new instance at any given time. Thanks
(comments are locked)
|
so do I need to attach this script to the prefab?? Right now i've got it on a controller object that simply creates and destroys other objects (and keeps score, etc).
Jun 29 '10 at 04:48 PM
Jeff Ciaccio
no, anywhere you like - as long as it keeps a reference to the prefab and the instantiated object
Jun 29 '10 at 05:02 PM
Mike 3
So within my script attached to the controller, I've got
Jun 29 '10 at 05:06 PM
Jeff Ciaccio
Need to swap it around a bit - you destroyed the object you're trying to instantiate. move the destroy after the instantiate, and it'll work fine
Jun 29 '10 at 05:11 PM
Mike 3
But how will it know which one to destroy since I will have two instances?
Jun 29 '10 at 05:13 PM
Jeff Ciaccio
(comments are locked)
|
