CapsuleCollider -> BoxCollider not causing OnTriggerEnter

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.

391111–13436–$triggertestpackage_379.unitypackage (3.95 KB)

One object or the other has to have a rigidbody component for colliders to trigger. It may work with a character controller instead of a rigidbody, too.

Ugh, that explains it. I was using a 3d character with a character controller last time I was able to get it to work, and someone told me then that I didn’t need to add a rigid body component. Thanks for the clarification.