How do I tween an automatic door with multiple parts?

I’m currently trying to get my head round coding a realistic automatic sliding door, essentially what im trying to do is incorporate CFrames with a tween. I’m using CFrames because of the lookvectors. However, I’m not quite sure how to do this. Any help is appreciated.

My code (so far):

-- Doors

local left = script.Parent.Parent.Left.Primary

local right = script.Parent.Parent.Right.Primary

-- Services

local TweenService = game:GetService("TweenService")

-- Config

local Config = require(script.Parent.Parent.Configuration)

-- Tablet position.

local Tablets = script.Parent.Parent.Tablets

-- UI Buttons

local Lock = Tablets:GetDescendants("Locked")

local ForceOpen = Tablets:GetDescendants("Force Open")

local ForceClose = Tablets:GetDescendants("Force Close")

local FireMode = Tablets:GetDescendants("Fire Mode")

local Hold = Tablets:GetDescendants("Hold")

-- Player Detection

local PlayerDetection = script.Parent.Parent.PlayerDetection

local DetectPart = PlayerDetection:GetDescendants()

-- Tweens

local TweenLInfo = TweenInfo.new(

5, --Time

Enum.EasingStyle.Linear, -- Style of door open animation

Enum.EasingDirection.In, -- Direction of easing.

-1, -- Repeat count.

false, -- Will it reverse?

0 -- The delay time.

)

-- open look vectors

local leftopen = {Position = left.CFrame == left.CFrame + (-left.CFrame.lookVector*14)}

local rightopen = {Position = right.CFrame == right.CFrame + (right.CFrame.lookVector*14)}

-- close look vectors

local leftclose = {Position = left.CFrame == left.CFrame + (left.CFrame.lookVector*14)}

local rightclose = {Position = right.CFrame == right.CFrame + (-right.CFrame.lookVector*14)}

local tweenLopen = TweenService:Create(left, TweenLInfo, leftopen)

local tweenLclose = TweenService:Create(left, TweenLInfo, leftclose)

local TweenRInfo = TweenInfo.new(

5, --Time

Enum.EasingStyle.Linear, -- Style of door open animation

Enum.EasingDirection.In, -- Direction of easing.

-1, -- Repeat count.

false, -- Will it reverse?

0 -- The delay time.

)

local tweenRopen = TweenService:Create(right, TweenRInfo, rightopen)

local tweenRclose = TweenService:Create(right, TweenRInfo, rightclose)

local UI = TweenInfo.new(

0.3, --Time

Enum.EasingStyle.Linear, -- Style of hover interact animation

Enum.EasingDirection.In, -- Direction of easing.

-1, -- Repeat count.

false, -- Will it reverse?

0 -- The delay time.

)

tweenLopen:Play()

not sure if you have everything welded correctly, but make sure you change the CFrame for rightopen etc, not the position.

Tweening a model’s PrimaryPart will not make the whole model move. You can use a CFrameValue (in this case 2), tween it and whenever its value changes; use :PivotTo() to set the model’s “CFrame”.

local TS = game:GetService("TweenService")
local Info -- your info

local Model -- etc
local CFValue = Instance.new("CFrameValue")
CFValue.Value = Model:GetPivot() -- starting position
CFValue.Parent = Model

local Tween = TS:Create(CFValue, Info, {Value = CFrame.new()})
Tween:Play()

CFValue.Changed:Connect(function(newvalue)
	Model:PivotTo(newvalue)
end)

He could unanchor every part and weld them to the PrimaryPart, that way tweening the PrimaryPart would influence every part welded to it.