Welcome to another mapping tutorial. This tutorial will take you through the basics of creating a working button, that when pressed, will turn on a light.
- Start off by opening up your map, or just create a simple room.
- Now, create a small brush to serve as your button, and place it where you want your button to be. For my button, I am using the dev/dev_measureswitch01 texture.
- Now, duplicate that brush, but this time, apply the tools/toolsnodraw texture to it, and place it right infront of the original brush.
- Using the entity tool(Shift+E), place the entity light within your map.
- With it selected, open up its properties menu and set its name to light_01
- Now head back to the button you created before, select the nodraw brush and press Ctrl+T and tie it to func_button.
- Switch to the Outputs tab, and add the following output:
Then, switch to the Flags tab and make sure that “Initially Dark” is checked. You can also change the other entity properties such as brightness and color if you want. All I’m doing is increasing the brightness.
-
MyOutputNamed: OnPressed
Target Entities Named: light_01
Via this Input: TurnOn
That’s it! Add in a spawn point and test out your switch ingame.
Buttons have hundreds of uses, this is just a basic example of a light switch.










