Welds during a tween

Hello, I’m trying to create a sliding door for a shop I am making. I have made sliding doors that used TweenService before, but now it doesn’t seem to be working as expected. I used weld constraints to connect parts of the door to a “Main brick” which would be tweened but wouldn’t be visible in the game. The “Main brick” does tween as intended, but the parts welded to it won’t budge.

The decorative door parts welded to the “Main brick” are unanchored, and the “Main brick” itself is anchored. The blue and pink bricks are placeholders for the position used in tweening.

Here’s the tweening script I wrote.

wait(2)
local TweenService = game:GetService("TweenService")

local end1 = {}
	end1.Position = workspace.Doors1.Door1.End.Position
local start1 = {}
	start1.Position = workspace.Doors1.Door1.Start.Position
local end2 = {}
	end2.Position = workspace.Doors1.Door2.End.Position
local start2 = {}
	start2.Position = workspace.Doors1.Door2.Start.Position



local tweenInfo = TweenInfo.new(1)
 
local Door1open = TweenService:Create(workspace.Doors1.Door1.Main, tweenInfo, end1)
local Door1close = TweenService:Create(workspace.Doors1.Door1.Main, tweenInfo, start1)
local Door2open = TweenService:Create(workspace.Doors1.Door2.Main, tweenInfo, end2)
local Door2close = TweenService:Create(workspace.Doors1.Door2.Main, tweenInfo, start2)


Door1open:Play()
Door2open:Play()
wait(2)
Door1close:Play()
Door2close:Play()

Any help would be much appreciated.

2 Likes

Actually I am having same problem too. I was making tinkerbell fly, but when I move her torso with tween other parts dont move. So I had to tween every single part inside her.

Tweening by CFrame and not position solves this problem

2 Likes

Above should work, I posted about the same exact situation, and I did not find much help on devforum, but I was, fortunately, able to figure it out on my own! Try this.

local TweenService = game:GetService("TweenService")

local end1 = {}
	end1.CFrame = workspace.Doors1.Door1.End.CFrame
local start1 = {}
	start1.CFrame = workspace.Doors1.Door1.Start.CFrame
local end2 = {}
	end2.CFrame = workspace.Doors1.Door2.End.CFrame
local start2 = {}
	start2.CFrame = workspace.Doors1.Door2.Start.CFrame



local tweenInfo = TweenInfo.new(1)
 
local Door1open = TweenService:Create(workspace.Doors1.Door1.Main, tweenInfo, end1)
local Door1close = TweenService:Create(workspace.Doors1.Door1.Main, tweenInfo, start1)
local Door2open = TweenService:Create(workspace.Doors1.Door2.Main, tweenInfo, end2)
local Door2close = TweenService:Create(workspace.Doors1.Door2.Main, tweenInfo, start2)


Door1open:Play()
Door2open:Play()
wait(2)
Door1close:Play()
Door2close:Play()