Detecting ragdoll colliders with OnTriggerEnter

Cheo

Active member
Hello, this might sound like a simple thing at first (and maybe it is), but I've been unsuccessfully trying to detect ragdoll colliders of a UCC character with the OnTriggerEnter method. The main capsule collider can be detected with no issue at all, but I really want to be able to detect ragdoll colliders, if it possible at least, maybe the way the character is handled and moved interferes with the detection. Thanks in advance.
 
And oh silly me, I only just tried using simple boxes with the Sub Character layer, and they seem to be unaffected by other objects and just fall through the ground if given a rigidbody.

If this limitation is absolutely necessary, then I can still make do with it, but is there no way to get this trigger detection working with Sub Character objects ?
 
I too thought I had met a limitation from Unity's physics system at first, but taking a closer look at this matrix we can see that a Static Trigger Collider can collide with a Kinematic Rigidbody Trigger Collider :

Capture d’écran (2381).png

You can check this out yourself by creating a simple cube with a kinematic rigidbody and manually dragging it into a trigger, it works as long as it's not using the Sub Character layer, even though by default the only unticked box in Unity's collision matrix for the Sub Character layer is the Boardable one from USC. It looks like something in UCC's code is affecting the Sub Character layer.

So I ask again : is this limitation unavoidable, and is there a way to detect ragdoll colliders with a trigger ?
 
Ah, at runtime LayerManager.Awake does a Physics.IgnoreLayerCollision(SubCharacter, Default) so that's why it's not triggering. This is to prevent unnecessary collision detections. Your solution is to have your trigger on a non default or visual effect layer.
 
Top