GetBoundingSize

Constructor:

GetBoundingSize()

Description

Retrieves the minimum size of the collider made up by all part objects under Model.

Return Value

Type Description
Vector3 Size of collision area (x, y, z)

Examples

Create a model, a mesh part and a part. Respectively set the mesh part and the part as the child of the model. Finally, retrieve the minimum size of the collider made up by all part objects under Model.

local model = RWObject.Create("Model") -- create a model
local meshpart = RWObject.Create("MeshPart") -- create a mesh part
meshpart.Position = Vector3(0,0.125,6) -- assign a vector to the mesh part position
local part = RWObject.Create("Part") -- create a part
part.Position = Vector3(4,0.125,3) -- assign a vector to the part position
part.Parent = model -- set the parent of the part as the model
meshpart.Parent = model  -- set the parent of the mesh part as the model
wait(2) -- wait 2
local dir = model:GetBoundingSize() -- retrieve the collision area size of the model
print(tostring(dir)) -- output the collision area size