Mod:Creation Kit/GetDistance - ObjectReference

Member of: Mod:Creation Kit/ObjectReference Script

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

Syntax
float Function GetDistance(ObjectReference akOther) native

Parameters

 * 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)

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