Hi!
I have been trying to make a script so that if the character (cube with a box collider) you control exits a capsule collider (cylinder) it destroys the game object of that character. Its going to be like a arena, if the character exits he falls off the arena and dies (the gameobject is destroyed).
I have this script attached on the arena (with the capsule collider).
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
void OnTriggerExit(Collider other) {
Destroy(other.gameObject);
}
}
But when the character (cube) exits the collider nothing happens with it.
Please help me, the scripts really seems fine to me.
Cheers!