How to correctly rig a bifold door

I’m not sure if I should put this in Building Support or Scripting Support, but it seems more like a rig problem than a script problem so Building Support felt more appropriate.


Right now I’m currently trying to rig a bifold door, but I’m not sure how to make the two parts of the door rotate independently from each other.

For reference, this is how the door is rigged. The primary part of the second half is welded to the first half:

And the script that tweens them rotates them separately:

		debounce = true
		doorClosed = false
		local doorSlideTween = TweenService:Create(door1root, doorSlideInfo, {
			CFrame = door1root.CFrame * CFrame.Angles(0,(math.rad(80)), 0)
		})
		doorSlideTween:Play()
		wait(0.01)
		local doorSlideTween3 = TweenService:Create(door2root, doorSlideInfo, {
			CFrame = door2root.CFrame * CFrame.Angles(0,(math.rad(-90)), 0)
		})
		doorSlideTween3:Play()
		wait(1.01)
		debounce = false
	elseif doorClosed == false and debounce == false then
		debounce = true
		doorClosed = true
		local doorSlideTween2 = TweenService:Create(door1root, doorSlideInfo, {
			CFrame = door1root.CFrame * CFrame.Angles(0,(math.rad(-80)), 0)
		})
		doorSlideTween2:Play()
		wait(0.01)
		local doorSlideTween4 = TweenService:Create(door2root, doorSlideInfo, {
			CFrame = door2root.CFrame * CFrame.Angles(0,(math.rad(90)), 0)
		})
		doorSlideTween4:Play()
		wait(1.01)
		debounce = false
	end
end

I’ve tried both anchoring and unanchoring the primary part of the second half, as well as welding another part of it. This is what happens with both combinations:

Does anyone know a way I could combine these effects? I’m sapped for ideas at this point.