Mod:Creation Kit/HasDirectLOS - ObjectReference

Member of: Mod:Creation Kit/ObjectReference Script

Checks to see if this reference has line-of-sight to the target object.

Syntax
bool Function HasDirectLOS(ObjectReference akTarget, string asSourceNode = "", string asTargetNode = "") native

Parameters

 * akTarget: The object to check line-of-sight to.
 * asSourceNode: The node to cast the line of sight check from. If empty, will cast from the root of the object.
 * Default: ""
 * asTargetNode: The node to cast the line of sight check to. If empty, will cast to the root of the object.
 * Default: ""

Return Value
True if this reference has line-of-sight to the object.

Examples
if (SpotlightRef.HasDirectLOS(Bob_Alias.GetReference)) Debug.Trace("The spotlight can see Bob") endIf if (SpotlightRef.HasDirectLOS(Bob_Alias.GetReference, asTargetNode = "Head")) Debug.Trace("The spotlight can see Bob's head") endIf
 * Can the spotlight "see" bob?
 * Can the spotlight "see" bob's head?