Table of Contents

Method Distance

Namespace
Anvil.API
Assembly
NWN.Anvil.dll

Distance(NwGameObject)

Returns the distance to the target.
If you only need to compare the distance, you can compare the squared distance using DistanceSquared(NwGameObject) to avoid a costly sqrt operation.

public float Distance(NwGameObject target)

Parameters

target NwGameObject

The other object to calculate distance from.

Returns

float

The distance in game units, or -1 if the target is in a different area.