i wont to destroy or disactive a GameOpject(Monster) and his childs(weapons) , i tried Disactive but it just DisActive the Monster without the chilrden
chidren = GetComponentsInChildren(Transform);
for (var child in children)
{
Destroy(child.gameObject);
}
var onoff : boolean;
var testObject : GameObject;
function Update ()
{
if (onoff == true)
testObject.active = true;
if (onoff == false)
testObject.active = false;
}
To Deactivate:
GameObject.Find("Monster").SetActiveRecursively(false);