Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

TweenPosition not working?

I'm not sure if I'm being stupid or if I'm doing it wrong, but the first part works yet when it gets to the second wait, nothing happens. There are no outputs...

wait(2)
script.Parent.Frame:TweenPosition(UDim2.new(0.4, 0, 0.2, 0),"Out", "Linear", 4, false)
wait(1)
script.Parent.Frame:TweenPosition(UDim2.new(1.4, 0, 1.2, 0),"Out", "Linear", 2, false)

Haaalp

1 answer

✓ Accepted answer

##Problem

The problem is you have the override argument set to false (the fifth argument). This means the first TweenPosition will continue to go until it is done. The second TweenPosition will not be able to take effect until the 4 seconds you defined (fourth argument) is up. Since the second TweenPosition was requested at a time the first TweenPosition was not done, that line will not take effect.


##Solution

There are two solutions to this problem,

  1. Have a longer wait.
  2. Set override to true.

Personally I go for the longer wait, since I prefer to see the full animation.


##Final Script

wait(2)
script.Parent.Frame:TweenPosition(UDim2.new(0.4, 0, 0.2, 0),"Out", "Linear", 4, false)
wait(4)
script.Parent.Frame:TweenPosition(UDim2.new(1.4, 0, 1.2, 0),"Out", "Linear", 2, false)

######Hopefully this answered your question. If so, do not forget to hit the accept answer button. If you have any questions, feel free to comment below.

This discussion is preserved as it was. New answers, comments, and votes are closed.