Adjacency Check

I’m trying to set up a script to check for adjacent objects touching a given object that the player rolls over. So if the player rolls over a box, for instance, and if that box is touching two other boxes, it will highlight all three.

I can test for contacts with the OnCollisionStay function, but this seems too costly to do for each object all the time.

Is there a way to trigger an equivalent function as OnCollisionStay that is only executed on mouse rollover?

You want to use OnCollisionEnter and OnCollisionExit instead.

Since your function will only be called when entering / exiting the collision, it will probably be not noticable performance wise.