Method Distance
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
targetNwGameObjectThe other object to calculate distance from.
Returns
- float
The distance in game units, or -1 if the target is in a different area.