Skip to main content

func_button

func_button icon
Brush entity

A func_button moves in and fires its targets when a player uses it, shoots it or touches it, and then comes back out. While it is pressed, it shows its alternate textures, the +a frames.

Attributes​

The entity also has these common keys:

KeyDescriptionDefault
Nametargetname

Triggering the entity presses it like a player does, but not with the flag Touch Activates. See Common keys.

Targettarget

Names the entities to trigger when the button is pressed, with the use type that Use type sets, and passes on the player who pressed it as the activator.

Delay before triggerdelay

Sets how many seconds pass between the press and the firing of its targets.

Default 0
Locked Soundlocked_sound

Sets the sound the entity plays when a player tries to use it while its Master locks it. A door also plays it when a player touches it and it only opens when triggered.

  • None (0)
  • Access Denied (2)
  • Small zap (8)
  • Buzz (10)
  • Buzz Off (11)
  • Latch Locked (12)
Default None (0)
Unlocked Soundunlocked_sound

Sets the sound the entity plays when it is used while it isn't locked. A button plays it when it is pressed, and a door when it starts to open.

The 12 choices
  • None (0)
  • Big zap & Warmup (1)
  • Access Granted (3)
  • Quick Combolock (4)
  • Power Deadbolt 1 (5)
  • Power Deadbolt 2 (6)
  • Plunger (7)
  • Small zap (8)
  • Keycard Sound (9)
  • Buzz (10)
  • Latch Unlocked (13)
  • Lightswitch (14)
Default None (0)
Locked Sentencelocked_sentence

Sets an announcer sentence group the entity speaks when a player tries to use it while it is locked. Each try plays the next sentence of the group, at most one every few seconds.

The 10 choices
  • None (0)
  • Gen. Access Denied (1)
  • Security Lockout (2)
  • Blast Door (3)
  • Fire Door (4)
  • Chemical Door (5)
  • Radiation Door (6)
  • Gen. Containment (7)
  • Maintenance Door (8)
  • Broken Shut Door (9)
Default None (0)
Unlocked Sentenceunlocked_sentence

Sets an announcer sentence group the entity speaks when it is used while it isn't locked. Each use plays the next sentence of the group.

The 9 choices
  • None (0)
  • Gen. Access Granted (1)
  • Security Disengaged (2)
  • Blast Door (3)
  • Fire Door (4)
  • Chemical Door (5)
  • Radiation Door (6)
  • Gen. Containment (7)
  • Maintenance area (8)
Default None (0)
Custom locked soundHalf-Life Unified SDKFeaturefullocked_sound_override

Sets a sound file that plays instead of Locked Sound when a player uses the button while it is locked. If you leave this key empty, the button plays Locked Sound.

Custom unlocked soundHalf-Life Unified SDKFeaturefulunlocked_sound_override

Sets a sound file that plays instead of Unlocked Sound when the button is pressed. If you leave this key empty, the button plays Unlocked Sound.

Custom locked sentenceHalf-Life Unified SDKFeaturefullocked_sentence_override

Sets the name of a sentence group of sound/sentences.txt, such as NA, which the entity speaks instead of Locked Sentence.

If you leave this key empty, the entity speaks Locked Sentence.

Custom unlocked sentenceHalf-Life Unified SDKFeaturefulunlocked_sentence_override

Sets the name of a sentence group of sound/sentences.txt, such as EA, which the entity speaks instead of Unlocked Sentence.

If you leave this key empty, the entity speaks Unlocked Sentence.

Object Hint TemplateFeaturefulobjecthint

Shows brackets around the object for players near it. Within Hint Distance, the brackets are faint and in the HUD color. When the player is close enough to use the object and looks at it, the brackets take the color of the choice.

  • None (empty) - No brackets
  • button - Yellow, and orange while a master locks the object
  • charger - Green, and red while the charger is empty
  • eyescanner - Yellow
  • pickup - Yellow
Default None (empty)
Hint Distanceobjecthint_distance

Sets how far from the player's eyes the faint brackets show, in units, up to 4096. The object must be in front of the player and in sight.

If you leave this key empty or set 0, the distance is 512 units.

Move withSpirit of Half-Lifemovewith

Names the parent, an entity that this one moves and turns with. The entity keeps the place and the angles it has on the parent in the editor. If several entities have the name, the first one counts. A name ending in .1 to .4 puts a sprite or a model that isn't solid on that attachment point of the model of the parent. A solid brush on a parent that turns needs its own origin brush. Moving objects explains it all.

If you leave this key empty, the entity doesn't move with anything.

Axis locksparentflags

Keeps some of the entity's own position or angles instead of following the parent. Add up the values of the axes to keep: 2 for X, 4 for Y, 8 for Z, 16 for pitch, 32 for yaw and 64 for roll. So 112 keeps the entity level. 0 follows the parent on every axis.

Default 0
Speedspeed

Sets how fast the button moves, in units per second, and 0 means 40.

Default 5
Healthhealth

Sets whether players shoot the button instead of using it. Above 0, any damage presses it, and players can't press it with their use key.

Liplip

Sets how many units of the button stay out when it is pressed in, and 0 means 4.

Mastermaster

Names a master, and while the master is off, the button is locked and plays its locked sound.

Soundssounds

Picks the sound the button plays when it is pressed.

The 13 choices
  • None (0)
  • Big zap & Warmup (1)
  • Access Denied (2)
  • Access Granted (3)
  • Quick Combolock (4)
  • Power Deadbolt 1 (5)
  • Power Deadbolt 2 (6)
  • Plunger (7)
  • Small zap (8)
  • Keycard Sound (9)
  • Buzz (10)
  • Buzz Off (11)
  • Lightswitch (14)
Default None (0)
Delay before resetwait

Sets how many seconds the button stays pressed before it comes back out and can be pressed again, and -1 keeps it pressed for good. With 0, it waits 1 second.

Default 3
Trigger before moveFeaturefultrigger_before_move

Names the entities to trigger when the button starts to move in.

Trigger on returnFeaturefultrigger_on_return

Names the entities to trigger when the button is back out.

Target when lockedFeaturefultarget_on_locked

Names the entities to trigger when a player uses it while its master keeps it locked, at most every 2 seconds.

Use typeFeaturefulusetype

Sets the use type its Target gets.

  • Off (-1) - The Target gets Off
  • Toggle (0) - The Target gets Toggle
  • On (1) - The Target gets On
  • On/Off (2) - With Toggle, On when the button goes in and Off when it comes out
  • Off/On (3) - With Toggle, Off when the button goes in and On when it comes out
Default Toggle (0)
Wait before toggling againFeaturefulwait_toggle

With Toggle, sets how many seconds pass before players can use the button again.

Custom soundHalf-Life Unified SDKnoise

Sets a sound file that the button plays instead of the Sounds choice.

Player use policyFeaturefuldirectuse

Sets how a player must look at the button to use it.

  • Default (0) - As for any object
  • Direct only (1) - The player must look straight at the button
  • Not through walls (2) - The player can't use the button through a wall
Default Default (0)

Flags​

1Don't move

The button doesn't move when it is pressed

32Toggle

The button stays pressed until it is used again, which brings it back out, and it fires its targets each time

64Sparks

The button gives off sparks while it isn't pressed

256Touch Activates

Players press the button by walking into it, not with their use key, and triggering the button does nothing

16384Player Can't UseFeatureful

Players can't press the button with their use key, but shooting it, touching it and triggers still work

Notes​

  • A scripted_sentence can make the button speak, and the sentence then plays from the button
  • Each player can turn the object hints off, or keep only the hint on what their use key would use, with the client setting cl_objecthint

See also​

Changes since 1.38​

  • You can use the new keys Object Hint Template, Hint Distance, Trigger before move, Trigger on return, Target when locked, Use type, Wait before toggling again, Custom sound, Player use policy and the custom locked and unlocked sounds and sentences, and the new flag Player Can't Use
  • A scripted_sentence can make a button speak, as in the Half-Life 25th Anniversary Update. In SBO 1.38, only monsters spoke