Codectionary / Developer documentation / Luau

Model pivots

Move an assembled Model using its pivot instead of changing each part separately.

Why use Model?

A Model groups objects into one unit. PivotTo, inherited from PVInstance, positions the whole group relative to its pivot and is useful for placing prefabs or moving an assembled prop.

Try it in Roblox Studio

Put a Model named PracticeModel containing at least one Part in Workspace, then put this Script in ServerScriptService. Set the model pivot in Studio if you need a specific reference point.

Syntax

model:PivotTo(CFrame.new(0, 10, 0))

Examples

Model pivots

Move an existing model ten studs above the origin.

local model = workspace:WaitForChild("PracticeModel")
assert(model:IsA("Model"), "PracticeModel must be a Model")
model:PivotTo(CFrame.new(0, 10, 0))
  1. WaitForChild finds the model created in Studio, and assert makes a wrong object type visible during testing.
  2. CFrame.new supplies the desired pivot position; PivotTo moves the model while retaining the relative arrangement of its descendants.
  3. The exact final position of each part depends on the model pivot and its existing offsets.

Best practices

  • Use PivotTo for a whole assembly rather than manually moving every part.
  • Check the pivot location in Studio when placement appears offset.

Runtime & versions

Luau host; Roblox engine examples require Roblox Studio. Feature availability depends on the language and runtime version used by your project; consult the official reference below.

Luau documentation

Specifications & further reading