- Home /
The question is answered, right answer was accepted
Reset a Gameobject to the original state
Hello, I'm trying to reset a GameObject at his original state. My game is like the old zelda games, you can go throught square maps (Like this). Each time you travel throught the square, they reset. All the enemies are alive, even the ones you killed. In my game i made prefabs of maps which contains the enemies. Is there an easy way to reset only the Gameobject like GameObject.reset?... If i delete this gameObject and re-instantiate it, i'm afraid it'll make the game lag.
I'm pretty sure my explanations aren't clear, if you need more details, i'm here. Thanks in advance
Did you try instantiating new objects and experience lag? I don't think it would be very likely unless there were very large numbers of objects to instantiate.
On the other hand, if you don't want to instantiate, you could simply deactivate the enemies when they are killed ins$$anonymous$$d of destroying them. That way you would only need to reset their positions and reactivate them to achieve the 'reset' effect.
Oh yes, actually that doesn't lag. If later it lags i'll try your second idea, it seems nice too.
$$anonymous$$any thanks