How do I make my door rotate around a specific part with TweenService?

I want to create a door that rotates around a hinge using tweenService.
I set the ClosedPos as the primary part of the model. The actual door is just a single part.

The ClosedPos

The OpenPos is the same thing but just oriented differently.
And still the door opens like this:

This is my code:

local TweenService = game:GetService("TweenService")
local Model = script.Parent.Parent
local OpenPos = Model.OpenPos
local ClosePos = Model.ClosePos
local Door = Model.Door
local DoorName = Model.DoorName.Value
local TriggerBrick = script.Parent
local IsMoving = false
local ForceOpen = false
local ForceClose = false

local TweenSetting =

local ClosePosCF = {CFrame = * CFrame.Angles(math.rad(ClosePos.Orientation.X), math.rad(ClosePos.Orientation.Y), math.rad(ClosePos.Orientation.Z))}
local OpenPosCF = {CFrame = * CFrame.Angles(math.rad(OpenPos.Orientation.X), math.rad(OpenPos.Orientation.Y), math.rad(OpenPos.Orientation.Z))}
local TweenOpenPos = TweenService:Create(Door, TweenSetting, OpenPosCF)
local TweenClosePos = TweenService:Create(Door, TweenSetting, ClosePosCF)
function openDoor()
	if ForceClose ~= true then
		IsMoving = true
	if ForceOpen ~= true then
	IsMoving = false
	IsMoving = false	
	local hum = part.Parent:FindFirstChild("Humanoid")
	if hum then

function closeDoor()
	IsMoving = true
	if not ForceOpen then
1 Like

Honestly I think in most games they position the tween to look like it moves around a hinge. Also, about that part where you set the properties of the door you want to tween. No need for CFrame.Angles. CFrame should account of position and rotation so I think you could remove that part. Maybe i’m missing something sorry.

When I do e.g


It throws me an error that it wants V3 not CF.

Ok I’ll check over your code right now.

Ok, so you can’t do {CFrame = ClosePos.CFrame?}
Well try doing CFrame =, ClosePos.Orientation)

Oh, I know why that happens. Remove the part since takes two arguments, Position of the item and the position you want the item to face. When you do you are trying to give a cframe value to the cframe.

You would want to create essentially a custom lerp that handles your CFraming to get a nice animation effect + a circular motion like a realistic door.

When tweening CFrame you might want to tween essential parts of the motion that you want the door to have if the tween won’t look realistic when you do it all the way. So make it tween halfway closed then make another tween that plays after it is halfway closed that makes it fully closed.
Example: When I am making a walk animation. If I just put the end position at the end without putting any key sequences in between I don’t know how the animation plugin will make the arms move to reach that position.

For example:

local door = game.Workspace.Part


local dX2 = door.Size.X / 2

local startCFrame = door.CFrame

function CFrameAtPercentage(p)
      return startCFrame 
                *, 0, 0) 
                * CFrame.Angles(0, math.rad(90) * p, 0) 
                *, 0, 0)

function LerpN(a, b, t)
      return a + (b - a) * t

local i = 0

while true do
     i = LerpN(i, 90, 0.05)
     door.CFrame = CFrameAtPercentage(i/90)

This bit of code creates a realistic circular rotation + a slowing down lerp effect.

Epic. Can you explain how that works so I can understand how to do it better? I want to learn these topics for myself since it is pretty useful.

Check the site for help. For example:

Oh nvm I understand now. Thanks for the link!

If you make the door a Model, and make the hinge the PrimaryPart of the Model, and all the Parts are Anchored, the script will rotate it around the PrimaryPart automatically.