Perhaps the docs are wrong? I would think that a collision is when two volumes intersect, not when they ‘touch’, and the physics engine resolved the collision after the ball landed on the box.
Just a guess though and I might be wrong, see if OnCollisionExit() is being fired to verify.
Make sure Collapse isn’t set in the console window. This will prevent you from seeing the debug log more than once.
I’m not sure offhand what happens when rigidbodies sleep, with OnCollisionStay. If you’re seeing a second or so of “test” messages, and then it stops, your Rigidbody is sleeping.
But, yes, OnCollisionStay is called once every frame as long as a Rigidbody is in contact with something…
More than two years and the docs haven’t yet been fixed? I just spent one hour trying to understand why my method wasn’t called, and I finally realized onCollisionStay is fired only if a rigidBody isn’t asleep. Grrrrr!
In my case OnCollisionStay is called but only if the script is attached to the rigidbody of my parent object, not when it is attached to one of the subcolliders. The problem is that I would like to get this function called on a gameobject holding one of the subcolliders component to know which collider actually collided.
Just be be clear of its timestep: Is onCollisionStay() using the fixed timestep, like it gets called everytime right after fixedupdate (default timestep 0.02)?