Part Position and Orientation


I’d like to rotate and position a part ontop of another part using the .Position and .Orientation properties.
I can’t use CFrame or Tweening as the part is Welded and Unanchored.


I manually did the math to determine the orientation and position changes, aswell as dividing it all by 1800 to get the amount to move each time the loop runs.

What it does:

The end product:

What I want it to do instead.
Basically to rotate and move into the “Closed” position.
Preferable in one smooth movement, instead of rotating then moving separately.
I can provide more clearance if it is required.


First thing, you should be changing the X’s rotation and not the Z’s. And since this is a 90 degrees rotation, it would be easier to make a for loop, that loops from the 0 to 90, and use the i variable to add to the rotation

Then to rotate it as wanted, this way

for i = 0, 90, 1 do
     local size = al.Size
     local pos = al.Position
     local cf =, pos.Y-(size.Y/2), pos.Z)*CFrame.Angles(math.rad(i), 0, 0)*,size.Y/2,0)
     --we don't set it's cframe to cf, we're just gonna use cf to determine Position and Orientation
     local rx, ry, rz = cf:ToEulerAnglesXYZ()
     al.Orientation =, math.deg(ry), math.deg(rz))
     al.Position = cf.Position

I think this should work, if you want information on what I did visit this.


@starmaq I’m assuming this line of code closes with an ‘)’?

local rx, ry, rz = cf:ToEulerAnglesXYZ(

A slight issue. It does this.