Scripting / Pivot method
GetPivot()
Returns the world-space pivot CFrame of a BasePart or Model.
Syntax
instance:GetPivot()Supported classes
| Name | Type | Description |
|---|---|---|
BasePart | CFrame | Returns the part's current CFrame. |
Model | CFrame | Returns the Model pivot chosen from its descendant BaseParts. |
Example: BasePart
Luau
local part = workspace:FindFirstChild("Part")
if part and part:IsA("BasePart") then
print(part:GetPivot().Position)
endExample: Model
Luau
local model = workspace:FindFirstChild("Vehicle")
if model and model:IsA("Model") then
local pivot = model:GetPivot()
print(pivot.Position)
endIf a Model has no descendant BaseParts,
GetPivot() raises a runtime error.