# Light switch with crosshair overlap.

**URL:** <https://forums.unrealengine.com/t/light-switch-with-crosshair-overlap/465250>\
**Category:** Platform & Builds\
**Tags:** crosshair, Switch, light, overlap, unreal-engine, Blueprint, question\
**Created:** [May 15, 2020, 10:10pm UTC](https://forums.unrealengine.com/t/light-switch-with-crosshair-overlap/465250 "2020-05-15T22:10:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SnipesEasy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SnipesEasy](https://forums.unrealengine.com/u/SnipesEasy)\
**Post date:** [May 15, 2020, 10:10pm UTC](https://forums.unrealengine.com/t/light-switch-with-crosshair-overlap/465250/1 "2020-05-15T22:10:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 15, 2020, 10:16pm UTC](https://forums.unrealengine.com/t/light-switch-with-crosshair-overlap/465250/2 "2020-05-15T22:16:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![SnipesEasy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SnipesEasy](https://forums.unrealengine.com/u/SnipesEasy)\
**Post date:** [May 15, 2020, 10:24pm UTC](https://forums.unrealengine.com/t/light-switch-with-crosshair-overlap/465250/3 "2020-05-15T22:24:19Z")

</div>

Could you please explain a bit more maybe with steps.

---

<div class="post-metadata">

**Author:** ![SnipesEasy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SnipesEasy](https://forums.unrealengine.com/u/SnipesEasy)\
**Post date:** [May 15, 2020, 10:59pm UTC](https://forums.unrealengine.com/t/light-switch-with-crosshair-overlap/465250/4 "2020-05-15T22:59:02Z")

</div>

And also with pictures please.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 16, 2020, 6:36am UTC](https://forums.unrealengine.com/t/light-switch-with-crosshair-overlap/465250/5 "2020-05-16T06:36:23Z")

</div>

This has been done many, many times before:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/4/3/f43ca26620277f551e47db0610cbfc7a4d06116b.jpeg "Unreal Engine 4 Tutorial - Widget Interaction Component 4.13") ](https://www.youtube.com/watch?v=eNQmhtJ7CXI)
