Help With Collision Detection on an "If" Statement?

Hello all!

I’m trying to make a game where you have to press a button when two objects are colliding. There’s like a triangle and you have to press a button when it spins over a rectangle.

The issue I have is that I have no idea how to implement this in C#. I’ve tried using Collision.Equals and OnCollisionEnter is obviously not what I’m looking for. Anyone have any ideas?

Since you know when the collision starts (OnCollisionEnter) and when the collision stops (OnCollisionExit), you only have to check if the player pressed the button sometime in between this “collision window”.

An OnCollisionStay could work but I’m not too sure how that can be implemented…