Hi,
I want to have a script on a object that destroys an other object. Does someone know how to do this?
Thanks
Hi,
I want to have a script on a object that destroys an other object. Does someone know how to do this?
Thanks
var other: GameObject;
function OnTriggerEnter(){
Destroy(other);
}
Untested but should work. Sometimes you cant setroy something due to its scripts, try
other.active=false;
or
other.gameObject.active=false;
or
other.enabled=false;
or other.SetActiveRecursively(false);
or maybe if you want rid of something you can move it far far away in 3d space
other.transform.position = Vector3(-100,-10000,-100000);
HTH
AC
Thank you! The script and
other.active=false;
Worked.