[HowTo] Interaction (Input) filter with Collider

How to filter a button when it cannot trigger when inside a BoxCollider (Trigger Enabled)?

You might find the answers in this thread.

The collider objects layer mask might be able to help, other than that you might just need to manage the state of the object or it’s colliders to turn on and off when inside the box. Objects without colliders can’t be interacted with.

Thank you! It’s work.