My program doesn't have bugs. It just develops random features.

UE2:LineOfSightTrigger (UT2004)

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
UT2004 Object >> Actor >> Triggers >> LineOfSightTrigger
This class in other games:
U2, U2XMP, UE2Runtime, UT2003

The line-of-sight trigger fires an event if a player looks in the direction of a specified actor while being within a certain distance from the LOS trigger and having a clear line of sight to that actor. The distance limitation is relative to the LOS trigger's location, while the direction and line of sight is relative to the target actor location.

Note: This actor only works offline and for the server player on a listen server, but not for any clients on a listen/dedicated server. It does not care whether that player actually participates in the game or is just a spectator.


Property group 'LineOfSightTrigger'[edit]


Type: bool

Whether the LOS trigger is ready to fire its event if the player sees it.

Default value: True


Type: int

How directly (in degrees) a player must be looking at the center of the actor marked by SeenActorTag.

Default value: 15


Type: float

Maximum distance player can be from the LOS trigger to activate it.

Default value: 3000.0


Type: name

Match the Tag of an actor which activates this LOS trigger when seen with this property's value. The LOS trigger will not work if this doesn't match the Tag of an existing actor in the level.

Internal variables[edit]


Type: bool

Whether the LOS trigger was already activated.


Type: float

Used internally.


Type: float

How directly player must be looking at SeenActor. 1.0 = straight on, 0.75 = barely on screen. This value is calculated automatically from the MaxViewAngle.


Type: Actor

The actor specified by SeenActorTag that needs to be looked at in order to activate this LOS trigger.

Default values[edit]

Property Value
bCollideActors False



event PlayerSeesMe (PlayerController P)

Fires the LOS trigger's Event the first time a player sees the trigger after it was enabled. If you want this function to be called again later, you need to manually set bTriggered to False from another UnrealScript function as there's no way to do that automatically.


event PostBeginPlay ()

Overrides: Actor.PostBeginPlay

Initializes the RequiredViewDir and SeenActor variables from MaxViewAngle and SeenActorTag respectively.


event Trigger (Actor Other, Pawn EventInstigator)

Overrides: Actor.Trigger

Enables the LOS trigger. Once enabled, there is no way to disable it again, apart from manually setting the bEnabled property to False from another UnrealScript function.