Rotating part around another part

I have been working on a gate, and I was wondering how I can have this gate pivot around the red part when it opens.

image

This is the part of code that I have for this gate, but it pivots the gate in the center instead of on the side. How would I go about changing my current code to allow for the gate to pivot on the right side(where the red part is) to allow for players to pass through?

local Tween1 = TweenService:Create(Gate1, info, {
	CFrame = Gate1.CFrame * CFrame.Angles(0, 0, math.rad(85))
})
1 Like

Have you changed the model’s pivot point through the transform tool?

This has already been answered on this site, please research before posting.

You have to multiply three things in a certain order.

Rotation * Pivot + Point

Rotation is the rotation you want, Pivot is the relative CFrame between the part and the part you’re rotating around, and point is the CFrame of the part you’re rotating around.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.