Moving a part to another one

Hi, short CFrame question:

How do I Move Part1 (White) to Part2 (Gray), like that?


Thanks for helping!

1 Like

Try this

p1.Position = --Move, but don't change orientation
    p2.Position + --Place center of p1 in center of p2
    p2.CFrame.RightVector * p2.Size.X / 2 + --Move center of p1 to right end of p2 
    p1.CFrame.RightVector * p1.Size.X / 2 --Move left end of p1 to right end of p2 (same as moving center of p1 to right end of p1 after the previous transformations)

it assumes that the long direction of the parts is the X direction.