Answered by
7 years ago Edited 7 years ago
The missing element which is causing the delay is that the tweening waits until it reaches the exact position, to be able to tween again.
TweenPosition() takes six parameters:
Parameter 1: End position as UDim2
2: Easing direction (which you have indicated as "InOut")
3: Easing style ("Quad", "Sine", "Elastic" etc.)
4: Time (The amount of time it takes to do the transition)
5: Override (Boolean value, if set to true = it has to reach its End position before it's
able to start another transition)
6: Callback function (Will return whether the tween will be able to start a transition)
To be able to fix this problem, you would want to set the Override value to true when you call TweenPosition() to true since you do not want the program to wait until the End Position is reached to execute another transition.
So the code will look something like this:
1 | local fight = script.Parent |
4 | fight:TweenPosition(UDim 2. new( 0.5 , - 200 , 0.5 , - 80 ), "InOut" , "Quad" , 1.5 , true ) |
6 | fight:TweenPosition(UDim 2. new( 0.5 , - 200 , 0.5 , - 60 ), "InOut" , "Quad" , 1.5 , true ) |
Hope this helped!