There is no spoon

UE2:LineOfSightTrigger (UT2004)

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 12:35, 20 December 2008 by Wormbo (Talk | contribs) (added descriptions)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
UT2004 Object >> Actor >> Triggers >> LineOfSightTrigger
Package: 
Engine
This class in other games:
UE2Runtime, UT2003, U2, U2XMP

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.

Properties[edit]

Property group 'LineOfSightTrigger'[edit]

bEnabled[edit]

Type: bool

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

Default value: True

MaxViewAngle[edit]

Type: int

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

Default value: 15

MaxViewDist[edit]

Type: float

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

Default value: 3000.0

SeenActorTag[edit]

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]

bTriggered[edit]

Type: bool

Whether the LOS trigger was already activated.

OldTickTime[edit]

Type: float

Used internally.

RequiredViewDir[edit]

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.

SeenActor[edit]

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

Events[edit]

PlayerSeesMe[edit]

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.

PostBeginPlay[edit]

event PostBeginPlay ()

Overrides: Actor.PostBeginPlay

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

Trigger[edit]

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.