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

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?

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:

Hope that helps!


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

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”