PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience

Position a Part at its Origin

Position a Part at its Origin

Jun 23 2018, 2:02 AM PST

Problem

You want to position a part at the origin using its CFrame.

Solution

Set a part’s CFrame property to a new CFrame value.

local part = Instance.new('Part')
part.Parent = Workspace
part.Anchored = true
part.CFrame = CFrame.new(0, 0, 0)

Discussion

Here we set part.CFrame to a new CFrame with the position (0, 0, 0) which is the origin. An alternative method to create the same CFrame value would be as follows.

part.CFrame = CFrame.new(Vector3.new(0, 0, 0))
Tags:
  • movement