Repository navigation
A3D_WalkRayCast
imshooter edited this page Oct 23, 2026
·
1 revision
Find where a straight walk between two points is stopped by a wall, a building, a ledge or the water.
The walk follows the ground, up and down slopes and stairs. A start off the mesh stops it where it starts.
native bool:A3D_WalkRayCast(
Float:fromX,
Float:fromY,
Float:fromZ,
Float:toX,
Float:toY,
Float:toZ,
&Float:x = 0.0,
&Float:y = 0.0,
&Float:z = 0.0
);| Parameter | Description | Default |
|---|---|---|
Float:fromX |
Start on the X axis. | |
Float:fromY |
Start on the Y axis. | |
Float:fromZ |
Start on the Z axis. | |
Float:toX |
End on the X axis. | |
Float:toY |
End on the Y axis. | |
Float:toZ |
End on the Z axis. | |
&Float:x |
Where the walk stops on the X axis. | 0.0 |
&Float:y |
Where the walk stops on the Y axis. | 0.0 |
&Float:z |
Where the walk stops on the Z axis. | 0.0 |
-
truewhen the walk is stopped. -
falsewhen the way is clear.
Unlike A3D_IsLineOfSight, the walk follows the floor. A wall, a fence, a step higher than 45 centimetres, a drop or deep water stops it, and a gap under a fence or a window does not let it through. Only where the end lies across the floor matters, not its height.
Whether a player can run to another in a straight line.
stock bool:CanRunStraightTo(playerid, targetid) {
new
Float:x,
Float:y,
Float:z,
Float:targetX,
Float:targetY,
Float:targetZ
;
GetPlayerPos(playerid, x, y, z);
GetPlayerPos(targetid, targetX, targetY, targetZ);
return !A3D_WalkRayCast(x, y, z, targetX, targetY, targetZ);
}- A3D_IsLineOfSight: Whether nothing stands between two points.
- A3D_GetNearestWalkPoint: Find the nearest point of the navigation mesh, where a pedestrian can stand.
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