SetEntityMatrix
DocsSetEntityMatrix(entity, forwardX, forwardY, forwardZ, rightX, rightY, rightZ, upX, upY, upZ, atX, atY, atZ)Description
Sets an entity's matrix. Arguments are in the same order as with GET_ENTITY_MATRIX.
Parameters
| Name | Type | Description |
|---|---|---|
entity | Entity | A valid entity handle. |
forwardX | float | — |
forwardY | float | — |
forwardZ | float | — |
rightX | float | — |
rightY | float | — |
rightZ | float | — |
upX | float | — |
upY | float | — |
upZ | float | — |
atX | float | — |
atY | float | — |
atZ | float | — |
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
voidThis native does not return a value.