Skip to main content

trigger_camera

trigger_camera icon
Point entity

A trigger_camera shows a player the view from the camera's position for a set time, looking at its target, and the camera can move along a path of path_corner entities. It can also show the view to every player and hide their HUD.

Attributes​

The entity also has these common keys:

KeyDescriptionDefault
Look targettarget

Names what the camera looks at, which is the first entity with this name. The camera also fires this target when it ends, unless you set Don't fire look target.

If you leave this key empty and the camera has no player to follow, it does nothing.

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
Hold timewait

Sets how many seconds the camera keeps the player's view. With Ignore Hold Time, the camera ignores this key.

If you leave this key empty or set 0, the camera ends at once.

Default 10
Path Cornermoveto

Names the first path_corner the camera moves along.

If you leave this key empty, the camera doesn't move.

Initial Speedspeed

Sets the camera's speed when it starts, in units per second. After that, the speeds of the path corners apply.

Default 0
Accelerationacceleration

Sets how fast the camera speeds up to a corner's speed, in units per second per second.

If you leave this key empty or set 0, it is 500.

Default 500
Stop Decelerationdeceleration

Sets how fast the camera slows down before a corner where it waits, in units per second per second.

If you leave this key empty or set 0, it is 500.

Default 500
Camera Rotation SpeedFeaturefulturnspeed

Sets how fast the camera turns to its target. With Instant Follow Turn, the camera ignores this key.

If you leave this key empty or set 0, it is 40.

Default 40
Stop by player inputFeaturefulstop_by_player_input

With "USE input", the player ends the camera with the use key.

  • No (0)
  • USE input (1)
Default No (0)
Target when turned offFeaturefulm_iszTurnedOffTarget

Fires this target when the camera ends: its hold time is over, it is turned off or the player stops it. The activator is the player, or the camera itself if nobody had its view.

Flags​

1Start At Player

The camera starts at the eyes of the player who triggered it, facing where they look. This flag is set by default

2Follow Player

The camera looks at the player who triggered it, instead of at its target. This flag is set by default

4Freeze Player

The player can't move or use anything while the camera has their view

8All Players

Every player who is alive when the camera starts gets its view, also if someone else turned it on. Each player gets their own view and controls back when it ends. Freeze Player, Player Invulnerable and Stop by player input apply to each player. The camera doesn't add players who join or respawn later

64Instant MoveFeatureful

The camera moves from path corner to path corner in straight lines, at the path's speed from the start

256Player InvulnerableFeatureful

The player takes no damage while the camera has their view

512Ignore Hold TimeFeatureful

The camera runs until you turn it off, so it ignores Hold time

1024Alive player onlyFeatureful

The camera only starts for an alive player, and it ends when that player dies or becomes a spectator. With All Players, it ends when none of its players is alive

4096Don't fire look targetFeatureful

The camera doesn't fire its Look target when it ends

8192Don't slow down if not Freeze PlayerFeatureful

Without Freeze Player, the camera's speed isn't damped in every frame

16384Don't skip the first path cornerFeatureful

The camera travels to the first path corner. Without this flag, it skips the first corner and moves to the second

32768Instant Initial TurnFeatureful

The camera faces its target at once when it starts

65536Instant Follow TurnFeatureful

The camera always looks straight at its target, without a turning speed

131072Hide HUD and crosshair

While the camera has a player's view, the camera hides their HUD: health, armor, ammo, weapon selection, the crosshair, the kill feed, the objectives panel, the game timer and the status icons. The chat, text from a game_text or an env_message, message boxes, tutor windows and env_overlay pictures stay. The HUD comes back with the view: when the camera ends, the player dies or starts to spectate, the round ends or the map changes

Hiding the HUD for a scene​

With Hide HUD and crosshair (131072), the camera shows the scene without the player's HUD, but a game_text caption still shows:

The same camera without the flag and with Hide HUD and crosshair: the caption stays, the HUD goes

A camera view with and without the HUD

Notes​

  • Without All Players, only the player who turns the camera on gets its view
  • If a monster, a timer or another entity turns the camera on, or the player is dead or a spectator, nobody gets the view. The camera still moves, ends and fires its targets
  • When nobody gets the view, Start At Player and Follow Player have no player to use. The camera starts where you placed it and looks at its Look target, and with Alive player only, it doesn't start
  • The player gets the view back when the camera ends, or when it is removed while it has their view. They also get the controls back if Freeze Player took them
  • At the end of a round, every camera gives its player the view and the controls back
  • The turning speed doesn't depend on the server's frame rate
  • With Move with, the camera moves with its parent and keeps its own aim and turning, so it still turns to look at its Look target. It ignores its own path while it has a parent. If you give it both, the console shows a message about it when developer 1 is set in the console. See Moving objects

See also​

Changes since 1.38​

  • You can use the new keys Camera Rotation Speed, Stop by player input and Target when turned off
  • You can use the new flags Instant Move, Player Invulnerable, Ignore Hold Time, Alive player only, Don't fire look target, Don't slow down if not Freeze Player, Don't skip the first path corner, Instant Initial Turn and Instant Follow Turn
  • trigger_camera has new All Players and Hide HUD and crosshair flags
  • Fixed a dead player or a spectator who turned a camera on keeping its view after the camera ended. Only living players get the camera's view now. This was a bug in SBO 1.38
  • Fixed the camera turning faster or slower with the server's frame rate
  • Fixed a trigger_camera started by a monster or a timer taking over the view of the player in the first server slot, even a spectator. When no player started the camera, the game gave the view to that slot