Destroying tweens to reduce lag

Recently, from my friend I’ve heard that it is important to destroy unused tweens, as doing otherwise will cause the game to lag. However, I couldn’t find anything about destroying tweens to reduce lag from both of the official Roblox pages about it, so now I’m not sure if what I’ve been told was true or not. Can I get a conformation ion this? Thanks!

Example of tween being deleted after it’s use:

local TI = game:GetService("TweenService")
local e = TI:Create(workspace.Part,TweenInfo.new(5),{Color = Color3.new(1, 0, 0)})

e:Play()
e.Completed:Wait()
e:Destroy()

I’m pretty sure tweens when they’re not used get automaticly garbage collected. (Dont quote me on this, im not sure though.)

1 Like

As the previous post speculated, as Tweens are like any ordinary instance, they too are garbage collected by the garbage collector every garbage collection cycle if they are deemed as garbage. Therefore destroying Tweens after creating them is unnecessary, unless you’re creating lots of Tweens in a single loop (which you likely shouldn’t do anyway).

2 Likes