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

Position a part via code

Position a part via code

Jun 23 2018, 2:02 AM PST

Problem

You want to position a part at an origin point and resize it.

Solution

Use Vector3 values to alter the Position and Size properties.

local part = Instance.new('Part')
part.Parent = Workspace
part.Size = Vector3.new(100, 1, 100)
part.Position = Vector3.new(0, 0, 0)
part.Anchored = true

Discussion

Here we create a new part and parent it to the Workspace. Next we change its size to be 100 as the length, 1 as the height, and 100 as the width. We also change its position to be at the origin and then anchor it.

Tags:
  • studio
  • resize
  • position
  • part