M MY Multiplayer: Wiki
Side
Kind

getElementBoundingBox

Client

Reads the collision box of an element's model, relative to the model's origin.

vec3, vec3|false getElementBoundingBox(element element)

Parameters

NameTypeDescription
elementelementThe element to read.

Returns

Two vec3, the box's minimum and maximum corners, or false if the element has no model or the model's collision is not loaded.

Example

local vehicle = getPedOccupiedVehicle(localPlayer)
if vehicle then
    local min, max = getElementBoundingBox(vehicle)
    outputDebugString(("length: %.1f m"):format(max.y - min.y))
end

See also