How to Stop a tween modifying the same property

Along the years, i noticed Tween:cancel() it’s inaccurate or simply doesn’t works

And i tried many methods before, like checking if it’s playing, etc

But , is there any better method to tween the same property and overriding that tween?, i know in the tween devhub says doing cancel will do that, but it doesn’t, or doesn’t works for me, let’s say i need to do a simple curtain open and closing script, i do the cooldowns and then put the respective tweens , the open and close, how will i fuse these?, so instead of waiting these to complete, i wouldn’t care about them bugging, because this will happen no matter what if the tweens are playing at the same cooldown

(i may be wrong)

local cd = false

if not cd then
cd = true
tweenOpen:Play()

else
cd = false
tweenClose:Play()

end

if i start to spam clicking the curtain, it will eventually, bug

Do this


local cd = false

if not cd then
cd = true
tweenClose:Stop()
tweenOpen:Play()

else
cd = false
tweenOpen:Stop()
tweenClose:Play()

end
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.