The Lab
MISC native

GET_HEADING_FROM_VECTOR_2D

returns float2 paramsbuild 1207

Returns the heading in degrees that points along the 2D direction (dx, dy).

Signature

C
float GET_HEADING_FROM_VECTOR_2D(float dx, float dy); // 0x38D5202FF9271C62 b1207

Parameters

#NameType
1dxfloat
2dyfloat

Facts

Facts about GET_HEADING_FROM_VECTOR_2D
Name
GET_HEADING_FROM_VECTOR_2D
Hash
0x38D5202FF9271C62
Namespace
Returns
float
Game build
1207

Examples

Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.

Lua
local result = Citizen.InvokeNative(0x38D5202FF9271C62, -- GET_HEADING_FROM_VECTOR_2D
  0.0, -- float dx
  0.0, -- float dy
  Citizen.ResultAsFloat()
)
print(result)
JavaScript
// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
const result = Citizen.invokeNative("0x38D5202FF9271C62", // GET_HEADING_FROM_VECTOR_2D
  0.0, // float dx
  0.0, // float dy
  Citizen.resultAsFloat()
);
console.log(result)
C#
float result = Function.Call<float>((Hash)0x38D5202FF9271C62, // GET_HEADING_FROM_VECTOR_2D
  0.0f, // float dx
  0.0f // float dy
);
All MISC natives

Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.