This is a very strange issue for me, because I have been able to successfully make OnTriggerEnter work in a different project but haven’t been able to since.
I have an empty game object with a box collider attached and trigger set to true. It also has this small TriggerDetector.cs script attached to it:
using UnityEngine;
using System.Collections;
public class TriggerDetector : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter (Collider other) {
print(other +" has entered");
}
void OnTriggerExit (Collider other) {
print(other +" has exited");
}
}
I have a cylinder with a capsule collider attached to it. The cylinder moves in and out of the box collider area with nothing being printed to the console. Very confusing. I don’t know how much simpler I can make this project, so I have created a package from this in case anyone else is willing to try it.