I have a model with a main anchored part. I also have a union in that model that is unanchored. The anchored main part is welded to the unanchored union part yet the unanchored union part gets left behind when the tween plays locally. However i don’t observe the same thing when its played on the server.
--CLIENT SIDE CODE
local Remote = game.ReplicatedStorage.Remotes:WaitForChild("Tween")
local TS = game:GetService('TweenService')
------------------------------------------------------------------------
--MAIN ENTERANCE DOORS
local function MainEnteranceDoors(TweenObject)
local LDoor = TweenObject.Left.Glass
local RDoor = TweenObject.Right.Glass
local LDoorOpenInfo = TweenInfo.new(.7, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, true, 0 )
local RDoorOpenInfo = TweenInfo.new(.7, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, true, 0 )
local LTGoal = {Position = LDoor.CFrame.Position + LDoor.CFrame.LookVector * 10 }
local RTGoal = {Position = RDoor.CFrame.Position + RDoor.CFrame.LookVector * 10 }
local LTween = TS:Create(LDoor, LDoorOpenInfo, LTGoal)
local RTween = TS:Create(RDoor, LDoorOpenInfo, RTGoal)
LTween:Play()
RTween:Play()
wait(.7)
LTween:Pause()
RTween:Pause()
wait(3)
LTween:Play()
RTween:Play()
end
-------------------------------------------------------------------
Remote.OnClientEvent:Connect(function(TweenObject, Instruction)
if Instruction == "MainEnteranceDoors" then
print(TweenObject)
MainEnteranceDoors(TweenObject)
end
end)
--SERVER CODE
local Remote = game.ReplicatedStorage.Remotes.Tween
local Doors = script.Parent.Parent
local Sensor = script.Parent
local TS = game:GetService('TweenService')
local LDoor = Doors.Left.Glass
local RDoor = Doors.Right.Glass
Sensor.Touched:Connect(function(obj)
if obj.Parent:FindFirstChild("Humanoid") then
Sensor.CanTouch = false
Sensor.Color = Color3.new(1, 0.027451, 0.0431373)
Remote:FireAllClients(Doors, "MainEnteranceDoors")
task.wait(5.5)
Sensor.CanTouch = true
Sensor.Color = Color3.new(0.568627, 1, 0)
end
end)