wait(1)
print("START")
local TweenService = game:GetService("TweenService")
local v = Instance.new("IntValue")
v.Changed:Connect(print)
local t = TweenService:Create(v, TweenInfo.new(1, Enum.EasingStyle.Linear), {Value = 3})
t.Completed:Connect(function() print("FINISH") end)
t:Play()
A use case is me rigorously testing TweenService without the overhead of having objects in the game tree.
But really, it’s just unexpected. For objects outside the game tree, properties are still settable, events still fire, functions are still callable, but tweens do not run.
Also, if you put an object in the game tree, start tweening, then immediately remove the object, the tween continues just fine.
wait(1)
local TweenService = game:GetService("TweenService")
local v = Instance.new("IntValue",workspace)
v.Changed:Connect(function(value) print(value, v.Parent) end)
local t = TweenService:Create(v, TweenInfo.new(1, Enum.EasingStyle.Linear), {Value = 3})
t.Completed:Connect(function() print("FINISH", v.Parent) end)
print("START", v.Parent)
t:Play()
v.Parent = nil
--> START Workspace
--> 1 nil
--> 2 nil
--> 3 nil
--> FINISH nil
This demonstrates that being a descendant of the game tree is not actually required in order for an object to tween, so why is it even a thing in the first place?