TweenService giving weird results with multiple tweens

Hello,
I just made a TweenService script but when I play the tweens, it’s giving me a weird result.
The problem is that when the first tween (Tween1) end, the second tween (Tween2) don’t start at the Position that the first tween (Tween1) end .
can someone help me? :thinking:

-- TweenService Script

local toolModels = game.Workspace.ToolModels
local cameraPart = toolModels.Frame:WaitForChild("CameraPart")
local startEnd = cameraPart:WaitForChild("StartEnd")
local startStartEnd = cameraPart:WaitForChild("StartStartEnd")
local startEndEnd = cameraPart:WaitForChild("StartEndEnd")
local TweenService = game:GetService("TweenService")

toolModels.ChildAdded:Connect(function(WeapModel)
    if WeapModel:IsA("Part") then
        local clickDetector = WeapModel:WaitForChild("ClickDetector")
        local bodyPosition = WeapModel:WaitForChild("BodyPosition")
        
        local goal1 = {}
        goal1.Position = startStartEnd.Position
        goal1.Orientation = startStartEnd.Orientation
            
        local goal2 = {}
        goal2.Position = startEndEnd.Position
        goal2.Orientation = startEndEnd.Orientation
        
        local goal3 = {}
        goal3.Position = startEnd.Position
        goal3.Orientation = startEnd.Orientation


        local tweenInfo = TweenInfo.new(2)

        local tween1 = TweenService:Create(WeapModel, tweenInfo, goal1)
        local tween2 = TweenService:Create(WeapModel, tweenInfo, goal2)
        local tween3 = TweenService:Create(WeapModel, tweenInfo, goal3)
        
        clickDetector.MouseClick:Connect(function()
            print("click")
            WeapModel.Anchored = false
            print("Start")
            tween1:Play()
            wait(2)
            tween2:Play()
            wait(2)
            tween3:Play()
            wait(2)
            print("Finish")
            WeapModel.Anchored = true
        end)
    end
end)

Wait(seconds) is not exact, the Tween might have not ended, so therefore, when you set the position, it goes back.
Instead of using wait(seconds), use Tween.Completed:Wait()
Not 100% sure it’ll work though.

tween1:Play()
tween1.Completed:Wait()
tween2:Play()
tween2.Completed:Wait()
tween3:Play()
tween3.Completed:Wait()
1 Like