Repository navigation
A3D_GetRandomWalkPoint
imshooter edited this page Oct 23, 2026
·
1 revision
Find a random point of the navigation mesh within a radius, which can be walked to from the centre, such as where an actor wanders next.
native bool:A3D_GetRandomWalkPoint(
Float:x,
Float:y,
Float:z,
Float:radius,
&Float:walkX,
&Float:walkY,
&Float:walkZ
);| Parameter | Description |
|---|---|
Float:x |
Centre on the X axis. |
Float:y |
Centre on the Y axis. |
Float:z |
Centre on the Z axis. |
Float:radius |
Distance from the centre, in metres. |
&Float:walkX |
Point found on the X axis. |
&Float:walkY |
Point found on the Y axis. |
&Float:walkZ |
Point found on the Z axis. |
-
truewhen a point was found. -
falsewhen the centre is off the mesh, or there is no navigation mesh.
The point can be walked to from the centre, so it is never behind a wall with no way around, on a roof or in a closed yard. The points spread over the walkable area within the radius.
Drops a pickup on a random spot a player can walk to.
stock DropLoot(modelid, Float:x, Float:y, Float:z, Float:radius) {
new
Float:lootX,
Float:lootY,
Float:lootZ
;
if (!A3D_GetRandomWalkPoint(x, y, z, radius, lootX, lootY, lootZ)) {
return -1;
}
return CreatePickup(modelid, 1, lootX, lootY, lootZ + 0.5);
}- A3D_GetNearestWalkPoint: Find the nearest point of the navigation mesh, where a pedestrian can stand.
- A3D_FindRoute: Find the best route between two points along the paths of the game.
3DAndreas 0.7.1 · Repository · Releases · MIT License
Guides
- Installation
- Configuration
- Physics objects
- Model settings
- World queries
- The screen
- Routes
- Navigation mesh
- Map database
- Coming from ColAndreas
- Performance
Reference
Functions