Light switch with crosshair overlap.

So basically i want to make a light switch but i want it only to work if my crosshair is over the button and within a certain box trigger.

When the player clicks:

  • check if the player overlaps trigger volume
  • line trace forward x distance, check if you hit the button

If both are True, switch the lights.

Could you please explain a bit more maybe with steps.

And also with pictures please.

This has been done many, many times before: