Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I cancel tweening?

Asked by 8 years ago

I saw something about tweening status, but I'm not sure how to use it. Any ideas on how to cancel tweening when it's in the middle of tweening?

0
It would be really nice if you could link us to where you found this "thing" about tweening status. It would also be nice if you would mind to elaborate what you mean by "how to cancel tweening when it's in the middle of tweening" Do you mean... How you can make it tween to a different possition/size when it's tweening to one specific one? KingLoneCat 2642 — 8y

1 answer

Log in to vote
2
Answered by 8 years ago

Solution:

There is a argument that tweening has which is a boolean and is set to false unless you yourself set it to true. This argument is the override of the tween. Meaning if the tweening can cancel out in the middle of it's tweening in order to tween to a different size/position. If this boolean is set to false the boolean can not be over-riden. However if it's true then it can be over-riden. You address this boolean at the end of the tweening process. Let's say image is the variable for the Gui that I am tweening. Specate this Script as I show you an example.

local image = script.Parent
image:TweenSizeAndPosition(UDim2.new(#, #, #, #), UDim2.new(#, #, #, #), "InOut", "Quad", .4 true) -- You can set the # to whatever you want it's just a representation of number. You may change the Easting Styles as you may like, as well. As you might notice the boolean at the end which I've set to true. Now I can tween this image to any other position/size I would like for it to tween to. Like this...
wait(.2) -- Waits for 0.2 seconds not 0.4 'cause then the tween would be over; we want it to tween, in the middle of it's tweening!
image:TweenSizeAndPosition(UDim2.new(#, #, #, #), UDim2.new(#, #, #, #), "InOut", "Quad", .4, true) -- Tweens the Gui to a different position if you change the #'s to some sort of different coordinates to tween to!

Anyways that's about all I needed to teach you about the 5th argument for the tweening called over-ride.

To learn more about the arguments of tweening I would suggest going here:

http://wiki.roblox.com/index.php?title=User:SoulStealer9875/Tutorials/Tweening

I hope I helped and thank you for using your precious time to read this answer.

~~ KingLoneCat

Ad

Answer this question