Method Distance
Distance(Location)
Returns the distance to the target.
If you only need to compare the distance, you can compare the squared distance using DistanceSquared(Location) to avoid a costly sqrt operation.
public float Distance(Location target)
Parameters
targetLocationThe other location to calculate distance between.
Returns
- float
The distance in game units, or -1 if the target is in a different area.