sm.pathfinder.getRandomPoint

Fetches a random point from the navmesh polys in a set radius. The point can be outside the radius but no polys outside the radius will be selected.

Kind: Function

Environments: Game

Game

sm.pathfinder.getRandomPoint( world, point, radius, abilities )

Open the full Game reference

Availability: Server only

Parameters:

Name Type Description
world World The world to look in.
point Vec3 The point.
radius number The radius to search in.
abilities (optional) table Table of actor abilities { canWalk=boolean, canSwim=boolean }. Defaults to all abilities.

Returns:

Type Description
Vec3 The new random point. (returns original point in case of failure)