getElementBoundingBox
Client
Reads the collision box of an element's model, relative to the model's origin.
vec3, vec3|false getElementBoundingBox(element element)
Parameters
| Name | Type | Description |
|---|---|---|
| element | element | The 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