So I'm trying to make an animated background for my game menu and i need to detect when the background is done tweening. I tried doing this but it kept erroring:
01 | local Patterntween = script.Parent:TweenPosition( |
02 |
03 | UDim 2. new( 0.509 , 0 , 1 , 0 ), |
04 | Enum.EasingDirection.In, |
05 | Enum.EasingStyle.Linear, |
06 | 10 , |
07 | nil |
08 |
09 |
10 | ) |
11 |
12 | while true do |
13 | wait() |
14 | if Patterntween.Completed = = true then |
15 | print ( "Tween done!" ) |
16 | end |
17 | end |
Someone please help!
I think you have to check the status on it, here is the code to fix it.
1 | if Patterntween = = Enum.TweenStatus.Completed then |
2 | print ( "The tween completed uninterrupted" ) |
3 | end |