Scripting / Model method
GetBoundingBox()
Returns a pivot-oriented bounding box that contains all descendant BaseParts in a Model.
Syntax
model:GetBoundingBox()Return values
| Name | Type | Description |
|---|---|---|
CFrame | CFrame | World-space centre and orientation of the bounding box. |
Size | Vector3 | Width, height and depth of the bounding box in that orientation. |
The bounding box uses the Model pivot orientation, so a rotated Model can return a rotated bounding-box CFrame.
Example
Luau
local model = workspace:WaitForChild("Vehicle")
local boundsCFrame, boundsSize = model:GetBoundingBox()
print(boundsCFrame.Position)
print(boundsSize)