My character has a trigger collider in front to detect obstacles to do auto jump. Due networking with authoritative server, I need to do sweeptests to detect collisions before ocurring.
The problem is, the sweeptest consider the triggers it contains as colliders, blocking the player movement. Is there a way to prevent this?
QueryTriggerInteraction.Ignore prevents sweeptests from triggering other triggers, but doesn’t affect the triggers it has.
Sweeptests should not collide their triggers. Is there a way to prevent this? Is this a bug?
Hey! Not sure if you already found a solution or not, but I’ve been trying to find a solution for hours and finally came up with something that works for me.
What I did was have the trigger on a child GameObject and (here’s the important part) add a Rigidbody on the trigger GameObject. It seems like any settings will work on it too (e.g. isKinematic).
From my experience, as of Unity 5, SweepTest and SweepTestAll include all colliders on the rigidbody’s GameObject and child GameObjects, regardless of layer or trigger status. HOWEVER, by having another Rigidbody on a child GameObject, it effectively excludes that from SweepTest calculations. Woo-hoo! =D
This is very important, because I was previously disabling the child trigger colliders prior to doing my SweepTestAll, but this causes a problem where OnTriggerExit is never called for these colliders, and the functionality simply does not work. With a single extra Rigidbody, all of my problems were solved!
Let me know if you get similar results. =}