The GetDistanceToObject() NWScript command returns the distance (in meters) from the caller (OBJECT_SELF) to the provided object. This will return -1.0 if the distance cannot be determined for some reason, such as when the object is in a different area than the caller, the object is invalid, or either the object or the caller does not have a location (e.g. an area).

The distance takes into account differences in the z-coordinate.


float GetDistanceToObject (object oObject)

object oObject 
The object whose distance from the caller will be determined.

See also Edit

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.