ON/OFF Lever

From Valve Developer Community
Jump to: navigation, search

Creating an ON/OFF lever in Black Mesa is simple. Some of the steps are similar to the Pipe Valve tutorial, with only a minor things to fix.


Introduction

First of all, we're going to create a func_door with the name door1

Later, we're gonna make the base. For that we create a prop_static with the world model faf_lever_box.mdl Adrik1-FafLever.png

Later, we create on a prop_dynamic with the world model faf_lever_handle.mdl, this will act as our lever/crank. Adrik1-FafHandle.png

Until done, we add a func_door_rotating with the name "button" and the INVISIBLE texture, this will make the prop_dynamic move.

Warning.pngWarning:It should be prop_dynamic_override instead of prop_dynamic, remember that!

Adrik1-DoorRotating.png

We create a new output, in this case, the OnOpen. Then add the name of the door (door1) and set as value Unlock

Note.pngNote:Make sure you put the door as locked in the flags option, otherwise won't work

Adrik1-DoorRotTriggerPart.png

In the lever/crank (prop_dynamic), we're gonna add as a parent the func_door_rotating with the name "button"

Parented lever
Blank image.pngTodo: Create examples for another type of stuff (elevators, etc)