Talk:IsNearPlayer - ObjectReference

There are no discussions on this page.

Sample code shows the OnUpdate() event continue as long as the player is within eyesight of the carriage driver:

 ;If the player leaves the driver, then reset the carriage
 If (driver.IsNearPlayer())
   RegisterForSingleUpdate(2.0)
 Else
   ResetCarriage()
 EndIf

--Sollar 10:27, 17 June 2012 (EDT)

The function first checks the cells of the object reference and the player. If one is in an interior cell, and the other isn't, it immediately returns false. Otherwise, if the distance between the two is greater than 3000 units, it returns false. Otherwise, it returns true. --Fg109 16:38, 17 June 2012 (EDT)
Return to "IsNearPlayer - ObjectReference" page.