I have a box with the Is Trigger on, and a mouse with a rigid body component and the following script:
using UnityEngine;
using System.Collections;
public class BlackBoxDestroy : MonoBehaviour {
void OnTriggerEnter (Collider coll) {
Destroy (coll.gameObject);
}
}
I’ve also tried it with tags:
using UnityEngine;
using System.Collections;
public class BlackBoxDestroy : MonoBehaviour {
void OnTriggerEnter (Collider col) {
if (col.gameObject.tag == “Mouse”)
Destroy (col.gameObject);
}
}
Neither have worked. Also tried other variations…HELP