- Home /
Question by
gheeler · Oct 01, 2013 at 03:07 PM ·
gameobjectdestroycomponent
Does Destroy() destroy all components?
As the question says, does
Destroy(myGameObject);
destroy all attached components? monobehaviours, materials etc..
thanks
Comment
Best Answer
Answer by Jojo B · Oct 01, 2013 at 03:17 PM
ye it removes the object from the scene and anything contained in it i.e components or other objects within it
Answer by vexe · Oct 01, 2013 at 03:20 PM
"Yes" - Says the docs.
If obj is a GameObject it will destroy the GameObject, all its components and all transform children of the GameObject.
Check the wiki for the meaning of Documentation
.
To sum it up: The docs is something you should always refer to BEFORE asking a question.