- Home /
Question by
david levy lee · Mar 30, 2015 at 11:48 AM ·
memory management
How to unload a gameobject?
I used Resource.Load to load a prefab , how can I unload the resources used by that prefab?(texture,sound...etc) I've tried Resource.UnloadAsset , but it said :
UnloadAsset may only be used on individual assets and can not be used on GameObject
What am I supposed to do?
Comment
Answer by _joe_ · Mar 30, 2015 at 12:15 PM
You can simply destroy it from the Hierarchy using:
Destroy(gameObject);
Your answer
Follow this Question
Related Questions
How many instances of a Object are handled in Unity 1 Answer
How is memory handled when using multiple variables to refer to Objects in the scene 0 Answers
2D Tilemap which way to go - memory-wise 1 Answer
Unity3D crashes when stopping from Debug mode: Is there a way to help it manage memory? 1 Answer