GetEntityHeadingFromEulers
Docslocal retval = GetEntityHeadingFromEulers(entity)Description
Gets the heading of the entity physics in degrees, which tends to be more accurate than just <code>GET_ENTITY_HEADING</code>. This can be clearly seen while, for example, ragdolling a ped/player.
Parameters
| Name | Type | Description |
|---|---|---|
entity | Entity | The entity to get the heading from. |
Quick Snippet: Get Entityentity
entityUse this to obtain an entity handle from the player's aim or crosshair.
-- Get the entity the player is aiming at
local ped = PlayerPedId()
local hit, entity = GetEntityPlayerIsFreeAimingAt(PlayerId())
if hit and entity ~= 0 then
print("Entity: " .. entity)
print("Model: " .. GetEntityModel(entity))
print("Type: " .. GetEntityType(entity)) -- 1=Ped, 2=Vehicle, 3=Object
endReturns
floatReturns a floating-point number.