astraIboy
(The Batman)
#1
So Im trying to Cancel this tween using tween:Cancel() and it printing this in the output
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()
un1ND3X
(ice)
#2
You can only call Tween:Cancel on Tween objects,
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
astraIboy
(The Batman)
#3
So I have to play the tween separately on a new line?
Edit : Ok thanks, it worked thanks for the help
1 Like