I have a problem that isn’t written anywhere in the docs.
Object A has a rigidbody and several child objects with; a boxcollider, 4 wheelcolliders.
Object B has a mesh collider which is a trigger, and a script to handle OnTriggerEnter events.
When these collide, no message is send. When I turn the mesh collider of object B into a boxcollider, I do receive a message.
I tried turning on ‘convex’ on the mesh collider, but that doesn’t help.
What is going on and what to do? I really need the mesh collider.
Hi and thanks. No, I didn’t read it, but it doesn’t help me any further either. My collider has a rigidbody and does move. The trigger doesn’t have one, and doesn’t need one.
The problem is the combination of a trigger and a mesh collider. If I only change the mesh collider into a box collider, everything works fine. Same for the trigger.
But how is that supposed to be normal? If I turn off the trigger, the two colliders do collide and bounce and everything. So if that works, why does the trigger not work then?
It’s just not detecting collision. No bug whatsoever. I have a script that calls debug.log() with some text in the OnTriggerStay() event, of which I am sure works (when I change the mesh to a box collider, it works, and also when it gets hit by a single collider, instead of compound collider).
I’m not sure if it is a bug or a known “missing” feature from the physics. Try contacting support@unity3d.com about this - they might be able to suggest something.
It’s definitely a bug.
I discovered what goes wrong. The problem lies within the child-parent relation. When the child is moved in world space, as a result of it’s parent movement, the trigger-test is not executed. When the child itself is moved, the check is done.
My solution is a script which does a translate of vector3.zero in the update method.
Well, if you’ve discovered a bug in Unity, it will help the developers out if you report it to them. There is an application called Report Bug in the folder with the Unity app that you can use to do this. You can also use it to request features or note mistakes in the documentation, etc.
I have the exact same problem in my car project, but I couldn’t understand what you meant by “translate of vector3.zero”. Can you please give some more details?
I am having the same problem, but I do not think the problem is in the trigger-test not executing. I think when the parent object rotates, the internal calculations on the child colliders are wrong so the colliders end up in the wrong place, even though the gizmos look correct.
In my case, the child’s collider ends up hitting another collider on the same game object causing the physics to go bersek. Same underlying problem, I think.
I have build the colliders consistent with the example in ‘composite colliders’ and do not have any on children of children. Problem persists and it is getting annoying having to work around it.