GetDistance - ObjectReference

From Creation Kit
Revision as of 2012-02-22T21:57:43 by Mr6 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Member of: ObjectReference Script

Calculates the distance in units between this object and the passed in one.


float Function GetDistance(ObjectReference akOther) native


  • akOther: The object to find the distance to.

Return Value

The distance between this object and the other one. (Objects should be in the same interior, or same worldspace, otherwise this will be a very large number)


; Find out how far away the player is from the chest (assuming they are in the same interior or worldspace)
Debug.Trace("Player is " + Game.GetPlayer().GetDistance(Chest) + " units away from the chest")

See Also