GET_GROUND_Z_AND_NORMAL_FOR_3D_COORD
Finds the ground below (x, y, z), writing its height to groundZ and the surface normal to normal. Returns true if ground was found.
Signature
BOOL GET_GROUND_Z_AND_NORMAL_FOR_3D_COORD(float x, float y, float z, float* groundZ, Vector3* normal); // 0x2A29CA9A6319E6AB b1207Parameters
| # | Name | Type |
|---|---|---|
| 1 | x | float |
| 2 | y | float |
| 3 | z | float |
| 4 | groundZ | float* (out pointer) |
| 5 | normal | Vector3* (out pointer) |
Facts
| Name | GET_GROUND_Z_AND_NORMAL_FOR_3D_COORD |
|---|---|
| Hash | 0x2A29CA9A6319E6AB |
| Namespace | |
| Returns | BOOL |
| Game build | 1207 |
Examples
Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.
local result, groundZ, normal = Citizen.InvokeNative(0x2A29CA9A6319E6AB, -- GET_GROUND_Z_AND_NORMAL_FOR_3D_COORD
0.0, -- float x
0.0, -- float y
0.0, -- float z
Citizen.PointerValueFloat(), -- float* groundZ
Citizen.PointerValueVector(), -- Vector3* normal
Citizen.ReturnResultAnyway()
)
if result then
-- ...
end// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
const [result, groundZ, normal] = Citizen.invokeNative("0x2A29CA9A6319E6AB", // GET_GROUND_Z_AND_NORMAL_FOR_3D_COORD
0.0, // float x
0.0, // float y
0.0, // float z
Citizen.pointerValueFloat(), // float* groundZ
Citizen.pointerValueVector(), // Vector3* normal
Citizen.returnResultAnyway()
);
if (result) {
// ...
}var groundZArg = new OutputArgument();
var normalArg = new OutputArgument();
bool result = Function.Call<bool>((Hash)0x2A29CA9A6319E6AB, // GET_GROUND_Z_AND_NORMAL_FOR_3D_COORD
0.0f, // float x
0.0f, // float y
0.0f, // float z
groundZArg, // float* groundZ
normalArg // Vector3* normal
);
float groundZ = groundZArg.GetResult<float>();
Vector3 normal = normalArg.GetResult<Vector3>();Related MISC natives
Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.