I’m simulating a bin-picking application in unity, and I have added some triggers near my sucking tool, in order to detect the pieces in contact with them and attach them to the tool. However, in many cases I can visually see that the trigger is colliding with the mesh collider of the piece but the OnTriggerEnter/OnTriggerStay signals are not being called, when I move a little bit around for some configurations they are called.
Here an image of the trigger and collider colliding without any detection:
The yellow object inside the red circle are the box triggers that represent the magnet, and the purple body is the piece to grasp which is composed of two convex mesh colliders.
Any idea about how to solve this problem? Are there any physics parameters I should modify?
Thanks, I didn’t know about rigidbody sleeping thank you very much.
I reduced the sleep threshold in the project settings to zero, so now rigidbodies do not go to sleep. However, now all pieces have a small jittering and I have a weird behaviour since the piece is entering the trigger and exiting in the next physics update, but visually it is always in collision with the trigger.
Is there any workaround I can do, to still make a trigger detect a sleeping rigidbody? or at least maintain the sleeping behavour until the trigger collides with it?