How do I stop the parent character capsule from activating it’s child triggers?
I have a box collider that is a trigger. OnTriggerEnter gets activated by it’s parent character controller and I can;t seem to get this ignored. If I use IgnoreLayerCollision (tried all parent and child layer combinations), or IgnoreCollision, OnTriggerEnter is never called.
public class LowerCollisionScript : MonoBehaviour
{
public static String otherTag = "Untagged";
void Start()
{
//Physics.IgnoreLayerCollision(31, 31);
//or
//Physics.IgnoreCollision(GetComponentInParent<CharacterController>(), GameObject.Find("LowerCollisionObject").GetComponent<BoxCollider>());
}
private void OnTriggerEnter(Collider other)
{
Debug.Log("lower collision entry"); //none of these are ever logged if using either IgnoreCollision
Debug.Log("lower collider name: " + other.name);
otherTag = other.gameObject.tag;
}
private void OnTriggerExit(Collider other)
{
Debug.Log("lower collision exit");
otherTag = "Scale";
}
}