i have wrote my script and it comes up with no errors. on collision with “Player” it is suppose to destroy the child object and it is not, here is the script
#pragma strict
function OnCollisionEnter(myCol: Collision){
if(myCol.gameObject.tag == "Player"){
var child = transform.GetChild(0);
GameObject.Destroy(child.gameObject);
}
}
why does this not work?
thanks