# How do I make a clickable button that will turn on and off a light?

**URL:** <https://forums.unrealengine.com/t/how-do-i-make-a-clickable-button-that-will-turn-on-and-off-a-light/284113>\
**Category:** UI\
**Tags:** button, click, unreal-engine, question\
**Created:** [May 24, 2014, 5:13am UTC](https://forums.unrealengine.com/t/how-do-i-make-a-clickable-button-that-will-turn-on-and-off-a-light/284113 "2014-05-24T05:13:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jellglob](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jellglob](https://forums.unrealengine.com/u/Jellglob)\
**Post date:** [May 24, 2014, 5:13am UTC](https://forums.unrealengine.com/t/how-do-i-make-a-clickable-button-that-will-turn-on-and-off-a-light/284113/1 "2014-05-24T05:13:40Z")

</div>

I want to know how you can make a button that, as my question states, turns on and off an object, like a light or something. I know of the whole “step into a triggervolume and POOF, light turns on” method, but that isn’t the same thing. I want it so that you actually have to PRESS a button, like a light switch, that will initiate an event(like turning on a lightswitch). I know in UDK3 you could easily do this, but I am having major trouble with this now. Any help?

---

<div class="post-metadata">

**Author:** ![Steve\_Allison](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Steve\_Allison](https://forums.unrealengine.com/u/Steve_Allison)\
**Post date:** [May 25, 2014, 6:35pm UTC](https://forums.unrealengine.com/t/how-do-i-make-a-clickable-button-that-will-turn-on-and-off-a-light/284113/2 "2014-05-25T18:35:47Z")

</div>

Hey Jellglob,

Are you trying to setup an actor that requires you to press a key on the keyboard to turn a lightswitch on and off, or a button/object in the level that you need to click, or a switch you need to stand on?

In either case, you’ll still want to use a trigger volume to determine that you’re close enough to an object to use it, which you can use a [Gate][1] to handle. If you are using a key press ('E" for example) to activate a switch that alternates on/off with each key press, you’ll also want to use a [FlipFlop][2] to easily toggle between the two states.

Here’s an example of what that setup could look like:

 ![7027-lightswitch.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/8/3/18376d011eda3fdd3408b550037084b9739ce52c.png)

Hope that helps!

-Steve

---

<div class="post-metadata">

**Author:** ![Juanunreal12](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Juanunreal12](https://forums.unrealengine.com/u/Juanunreal12)\
**Post date:** [October 14, 2016, 11:51pm UTC](https://forums.unrealengine.com/t/how-do-i-make-a-clickable-button-that-will-turn-on-and-off-a-light/284113/3 "2016-10-14T23:51:19Z")

</div>

What if instead of “E” I want to use my left mouse click

---

<div class="post-metadata">

**Author:** ![wookaseek](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@wookaseek](https://forums.unrealengine.com/u/wookaseek)\
**Post date:** [October 15, 2016, 12:02am UTC](https://forums.unrealengine.com/t/how-do-i-make-a-clickable-button-that-will-turn-on-and-off-a-light/284113/4 "2016-10-15T00:02:26Z")

</div>

Go to  
“Edit” → “Project Settings”,  
then under “Engine” section you will see “Input” and there you have “Bindings”.  
Under “Action Mappings” you should have your action mapped to “Key E” so just add another one by clicking “plus sign” or change this “Key E” to “Left Mouse Button”
