point_viewcontrol

From Source Entities
Jump to navigation Jump to search

Code classes:

point_viewcontrol is a point entity present in all Source games. Players can be forced to see the world through this entity.

Warning: Various weird behavior results when using the entity's native ability to follow path_tracks. It's recommended to attach the entity to a func_tracktrain using logic_measure_movement or to use the code fixes detailed here.

Warning: In multiplayer games, players will be stuck seeing out of the point_viewcontrol if the entity is deleted or they die while viewing.

Bug: Parenting does not work.

Bug: The entity needs something to look at, otherwise it won't move on path_tracks.

Tip: Css.pngDods.pngThis entity is used for the spectator view when first entering the server. The game uses the first point_viewcontrol it finds. You don't have to change any settings.

Flags[edit | edit source]

  • 1: Start At Player - When enabled, the entity sets itself to begin at the player's view.
  • 2: Follow Player - Makes the entity look at the player.
  • 4: Freeze Player - Prevents the player from moving around, shooting, etc. Bug: Causes camera movement to change drastically! Seen in Hl2.png.
  • 8: Infinite Hold Time - Makes the camera active indefinitely, until told to shut off via Disable.
  • 16: Snap to goal angles - Not useful. Snaps the camera to start at the angle of its first path_track.
  • 32: Make Player non-solid - Makes the player not collide with things.
  • 64: Interruptable by Player - Allows the player to regain control of their view simply by shooting, moving around, etc.
  • 128: Set FOV (available in all games since L4d.png) - Allows the entity to change the player's FOV (and reset it to normal once disabled).

Keyvalues[edit | edit source]

Entity to Look At (target) <target_destination>
Entity to point towards and track while active.
Target Attachment (targetattachment) <string>
If set, the camera will focus on the specified attachment on the Entity to Look At.
Tip: View attachment points with ent_attachments.
Hold Time (wait) <float>
The amount of time the camera should control the player's view for, after which it deactivates itself. If the camera should stay active perpetually, set the Infinite Hold Time spawnflag.
Path Corner (moveto) <target_destination>
The first path_track in a series that the camera should move to once activated. If not specified, the camera won't move anywhere.
Acceleration units/sec^2 (acceleration) <float>
How many units per second, per second, that the camera will speed up, to reach the speed desired by the path_track if that entity wants it to be faster.
Stop Deceleration units/sec^2 (deceleration) <float>
How many units per second, per second, that the camera will slow down, to reach the speed desired by the path_track if that entity wants it to be slower.
Interpolate Position To Player (interpolatepositiontoplayer) <boolean> (only available in Hl2.pngEpisodicP1.png)
Seems to be broken.
Field of view/FOV (fov) <float> (available in all games since L4d.png)
If Set FOV is checked, the FOV to change to.
Seconds to reach FOV target/FOV rate (fov_rate) <float> (available in all games since L4d.png)
If Set FOV is checked, how long to spend shifting to and from Field of view.
Tracking Speed of the camera (trackspeed) <float> (available in all games since P2.png)
How quickly (degrees per second) the camera will rotate to point toward Entity to Look At.

Inputs[edit | edit source]

Enable <string>
Takes control of the activator's view (or, the first/only player on the server). In L4d2-small.png, a survivor's name can specified as the one to control, such as !zoey or !nick.
Disable
Restores the player's view. Bug: If the camera is moving while this is sent, it will keep going in that direction, eventually leaving the map entirely.
SetTarget <target_destination> (available in all games since P2.png)
Sets Entity to Look At.
SetTargetAttachment <string> (available in all games since P2.png)
Sets Target Attachment.
ReturnToEyes  (available in all games since P2.png)
Shifts the view back to the player's eyes (instead of a sudden cut).
TeleportToView  (available in all games since P2.png)
Teleports the player to the position and angles of the camera.
SetTrackSpeed <float> (available in all games since P2.png)
Sets Tracking Speed of the camera.
SetPath <target_destination> (available in all games since P2.png)
Makes the camera begin following a new path.

Outputs[edit | edit source]

OnEndFollow
Fired when the entity deactivates through any of these means:
  • The Disable input being sent
  • The Entity to Look At being destroyed
  • The Hold Time expiring

See Also[edit | edit source]