Collision detection when objects already touch at runtime

How do you detect a collision between two objects at runtime if both are already touching each other at runtime?

For my app, the user rolls a ball on a floor surface. I need to run something when the ball is in any sort of contact with the floor. Since the ball rests on the floor on runtime, my function isn’t working. It does work when the ball is jumped and then hits the floor…

I place something similar on my floor object:

function OnCollisionEnter(theCollision : Collision){
 
 if(theCollision.gameObject.name == "ball"){
  
  \\some action
            	
 }

}

Thanks!

OnCollisionEnter is called at the moment of two objects collide with each other, and then if the two objects stay together(not bounce back and separated), OnCollisionStay will be called until they are separated, similarly, OnCollisionExit will be called at the moment of two objects separated.

So I guess what you need to do is keep your logic inside OnCollisionStay().