Background for Skyrim SE
Member of the ObjectReference script
floatfunctionGetDistance(ObjectReferenceakOther)Native

Description

Wiki Description

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

Documentation Comment

Calculates the distance between this reference and another - both must either be in the same interior, or same worldspace


Caveats


Parameters

ObjectReferenceakOther

CK Wiki Description

The object to find the distance to.


Examples

; 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")

Auto-Generated Example

ObjectReference myObjectReference__akOther

float returnedValue = myObjectReference__toCallFunctionOn.GetDistance(myObjectReference__akOther)

Related Pages


Additional References

View this function’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.