From Valve Developer Community
Jump to: navigation, search

func_rot_button is a brush entity available in all Source games. It is a rotating version of func_button. When used, it rotates to a pressed position instead of sliding to one.

In code it is represented by class CRotButton, defined in buttons.cpp.


Master (Obsolete) <string>
Deprecated. Legacy support: The name of a master entity. If the master hasn't been activated, this button cannot be used.
Speed <integer>
The speed that the button rotates, in degrees per second.
Health (Obsolete) <integer>
Deprecated. Legacy method of specifying whether or not the button can be shot to activate it. Use the 'Damage Activates' spawnflag instead.
Sounds <choices>
Sound when pressed
Value Description
0 None (Silent)
21 Squeaky
22 Squeaky Pneumatic
23 Ratchet Groan
24 Clean Ratchet
25 Gas Clunk

This sounds are for HL2 and Counter Strike Source. For other games, you need to check the sounds declared in scripts/game_sounds_world.txt.
Choose a sound declared with a name like "Buttons.sndXX" (where XX is a number), AND be sure that the sound file exists in the vpk.
Then deactivate smartedit, and put the number (XX) as value.

Delay Before Reset (-1 stay) <integer>
Amount of time, in seconds, after the button has been pressed before it returns to the starting position. Once it has returned, it can be used again. If the value is set to -1, the button never returns.
Distance (deg) <integer>
The amount, in degrees, that the button should rotate when it's pressed.
Minimum Light Level <string>
The minimum level of ambient light that hits this brush.


Name <string>
The targetname that other entities refer to this entity by.
Entity Scripts <scriptlist> (New with Left 4 Dead 2)
Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.
Script think function <string> (New with Left 4 Dead 2)
Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call.
Note:Try to avoid expensive operations in this function, as it may cause performance problems.


Parent <targetname>
Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma.


Origin (X Y Z) <origin>
The position of this entity's center in the world. Rotating entities typically rotate around their origin.


Pitch Yaw Roll (Y Z X) <angle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.


Global Entity Name <string>
Name by which this entity is linked to another entity in a different map. When the player transitions to a new map, entities in the new map with globalnames matching entities in the previous map will have the previous map's state copied over their state.


Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (probably with the Enable input).


  • 1 : Not solid
  • 2 : Reverse Dir
  • 32 : Toggle
  • 64 : X Axis
  • 128 : Y Axis
  • 256 : Touch Activates
  • 512 : Damage Activates
  • 1024 : Use Activates
  • 2048 : Starts locked



Removes this entity and any entities parented to it from the world.
Functions the same as Kill, although entities with a large number of children are killed marginally faster.
AddOutput  <string>
Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
Format: <key> <value>
Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1 to FireUser4
Fire the OnUser outputs; see User Inputs and Outputs.
Use  !FGD
Same as a player invoking +use; may not do anything. Can also be invoked by creating an output that does not specify an input.
This input is not included in Valve's FGDs.
RunScriptFile  <script> (New with Left 4 Dead 2)
Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
RunScriptCode  <string> (New with Left 4 Dead 2)
Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console.
Bug:  In <Left 4 Dead 2>, the code is executed in the script scope of the entity that fires the output, not the one receiving the input.
Warning: Never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor.
CallScriptFunction  <string> (New with Left 4 Dead 2) !FGD
Execute a VScript function in the scope of the receiving entity.
Note:This input is missing from some games FGD files.
SetLocalOrigin  <origin> (New with Alien Swarm) !FGD
Set this entity's origin in the map.
Note:This input is missing from some games FGD files.
SetLocalAngles  <angles> (New with Alien Swarm) !FGD
Set this entity's angles in the map.
Note:This input is missing from some games FGD files.


SetParent  <string>
Move with this entity. See Entity Hierarchy (parenting).
SetParentAttachment  <string>
Change this entity to attach to a specific attachment point on its parent. The entity will teleport so that the position of its root bone matches that of the attachment. Entities must be parented before being sent this input.
SetParentAttachmentMaintainOffset  <string>
As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
Removes this entity from the the movement hierarchy, leaving it free to move independently.


Lock the button, preventing it from functioning.
Unlock the button, allowing it to function.
Activate the button as if it was pressed.
Activate the button as if it was pressed, sending it to the bottom position.
Unpress the button, sending it to the top position.


Enable/disable this entity from performing its task. It might also disappear from view.



OnUser1 to OnUser4
These Outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 Input; see User Inputs and Outputs.
OnKilled  (New with Left 4 Dead)
This Output fires when the entity is killed and removed from the game.


Fired when the button is damaged.
Fired when the button is pressed.
Fired when the button is used while locked.
Fired when the button reaches the in/pressed position.
Fired when the button reaches the out/released position.

See also