- Home /
How can i call the 'col' object from the Update function?
There's the code:
var sound : AudioClip;
function Update() {
}
function OnTriggerEnter(col : Collider) {
if(col.tag == "Rabbit") {
col.GetComponent(RabbitS).enabled = false;
col.GetComponent(RabbitS).health = 0;
gameObject.audio.PlayOneShot(sound);
gameObject.animation.Play("Trap");
transform.FindChild("GameObject").collider.enabled = false;
}
}
I want to delete the 'col' gameObject, but i don't know how to call it.
Comment
Answer by Kiwasi · Jun 28, 2014 at 10:24 AM
col.gameObject
I should have rejected this on principle. Do you know there is a massive amount of documentation for unity? It can be found using google