Tween:Cancel() Not working

So Im trying to Cancel this tween using tween:Cancel() and it printing this in the output
image
CODE

local tween = game:GetService("TweenService"):Create(Location,TweenInfo.new(.35,Enum.EasingStyle.Circular, Enum.EasingDirection.InOut, -1, true,0), {StudsOffset = Vector3.new(0,11,0)}):Play()
wait(5)
tween:Cancel()

You can only call Tween:Cancel on Tween objects,
:heavy_check_mark:

local tween = game:GetService("TweenService"):Create(Location,TweenInfo.new(.35,Enum.EasingStyle.Circular, Enum.EasingDirection.InOut, -1, true,0), {StudsOffset = Vector3.new(0,11,0)})
tween:Play()
wait(5)
tween:Cancel()

Yours:

local tween = game:GetService("TweenService"):Create(Location,TweenInfo.new(.35,Enum.EasingStyle.Circular, Enum.EasingDirection.InOut, -1, true,0), {StudsOffset = Vector3.new(0,11,0)}):Play()

That isn’t the tween, since you call Play() at the end, and Tween:Play() doesn’t return a Tween object.

Edit: Yeah, play it on a new line if you need to hold reference to the tween object.Yes.

1 Like

So I have to play the tween separately on a new line?

Edit : Ok thanks, it worked thanks for the help

1 Like