point_anglesensor

From Source Entities
Jump to navigation Jump to search

Code classes:

point_anglesensor is a point entity present in all Source games. It detects if an entity points toward another for a period of time.

Flags[edit | edit source]

  • 1: Use target entity's angles (NOT position) - Instead of measuring if Target Entity is pointing at Look At Entity, it measures if they're facing in the same direction.

Keyvalues[edit | edit source]

Target Entity Name (target) <target_destination>
Name of the entity whose angles will be sensed.
Look At Entity (lookatname) <target_destination>
Entity to check if Target Entity is pointed towards.
Duration (duration) <float>
How long Target Entity must look at Look At Entity to fire OnFacingLookat.
Tolerance (tolerance) <float>
How many degrees off Target Entity can point at Look At Entity while still counting as looking at it. 0 means the target must point perfectly at the other entity. 180 means the direction can be anything.
Start Disabled (StartDisabled) <boolean>
Stay inactive until Enabled.

Inputs[edit | edit source]

Test
Immediately fires OnFacingLookat or OnNotFacingLookat depending on if the Target Entity is looking at Look At Entity within Tolerance.
SetTargetEntity (Not in FGD) <target_destination>
Sets Target Entity.
Enable
Makes the entity active.
Disable
Makes the entity inactive.
Toggle
If on, turn off. If off, turn on.

Outputs[edit | edit source]

FacingPercentage <float>
Constantly fires. Automatically puts a value (closer to 1.0 when pointing at Look At Entity and closer to 0.0 when not) as the input parameter, unless overridden by the mapper. (Hits 0 when not within Tolerance.)
TargetDir <vector>
Fires every time the Target Entity changes its angle. Automatically puts the new angles as numbers from -1.0 to 1.0 as the input parameter, unless overridden by the mapper.
Note: This is not very useful, as there are practically zero inputs that take a vector.
OnFacingLookat
Fires when the Target Entity has looked at Look At Entity within Tolerance for Duration, or when it's looking at it when the entity is sent the Test input.
OnNotFacingLookat
Fires when the Target Entity is not looking at Look At Entity within Tolerance when the Test input is sent.

See Also[edit | edit source]