So, I have an empty object “top” with Rigid body on it. It contains three child objects with sphere colliders (no rigid bodyes on them).
On the “top” object I put a script with OnCollisionStay and OnCollisionEnter implementation.
Whenever object collides with a floor (with all three colliders) the OnCollisionEnter (and OnCollisionStay per frame) fires three times (one firing for each object with sphere collider).
I expected, since I have only one Rigid body on the top of the hierarchy of colliders, there will be only one OnCollisionStay for this Rigid body. I don’t know why I expect this. Maybe some where in the past it works like this?
I found this article: Best Practices For Rigid Bodies in Unity – Digital Opus
and here there also said: “… If the cube, ball and cylinder were all grouped in the hierarchy under a single rigid body then there would be one OnCollisionStay call…”
Do I miss some changes in collisions behavior logic in Unity some time ago?
Is there any elegant way to filter all unwanted OnCollisionEnter (OnCollisionStay, OnCollisionExit) calls and stay with only one call for the rigid body on the top of the hierarchy?