Creating Parts Between Others

Creating Parts Between Others

Jun 14 2019, 4:48 PM PST


You want to position a part halfway between two other parts.


Use the Vector3:Lerp method with an alpha of ½.

local part = Instance.new('Part')
part.Parent = game.Workspace
part.Anchored = true
part.Position = Workspace.Part.Position:Lerp(Workspace.Part2.Position, .5)


The Lerp function will take two vectors and an alpha (the last argument, a number between 0 and 1) and according to the alpha will create a new vector between the two other positions. So if the alpha is .5 (or one half) it will create a Vector halfway between the two other vectors (in this case “Part” and “Part2”).

  • movement
  • vector3
  • lerp
  • script
  • coding