I have a parent object that has CharacterController and three child objects.
The child objects are 3 objects each with a CapsuleCollider marked as Triggers.
I have scripts attached to the child objects that should capture OnTriggerEnter and OnTriggerExit.
These events are not being fired when the CapsuleColliders enter a trigger.
Am I missing something in the way CharacterController effects child objects’ colliders?
Do you have a rigidbody on the child objects? You will probably need one for the triggers to work - I think it can be kinematic, so it needn’t affect the motion of the objects.
The parent object has the Rigidbody script. I do not have Rigidbody scripts attached to the child objects.
So I’ve found what I believe to be a solution but I would like verification of its “correctness”.
I remember reading that having child rigidbodies is a bad idea, but here it is.
I’ve removed the rigidbody of the parent, which also has the CharacterController script attached. I then added the rigidbody script to each of the 3 children objects and set them as kinematic. I now get the OnTriggerEnter and OnTriggerExit messages.
Is this an acceptable solution?
I don’t see any problem with that - child rigidbodies are more likely to do surprising things when they are not kinematic.