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

tween service glitching mouse button 1 click?

Asked by 5 years ago
Edited 5 years ago

Hello im having problem with this so i click text button and the buttons need to go to that position but it does not or just some come how can i fix that?

```

Removed for security cause someone already stole it

0
can u send a gif? NickAtNick 163 — 5y
0
Create the function first before running it, by that I mean place the function above the event, if that doesn't work try to post a gif so we could know more. MArzalAlBuchariZ 33 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Your issue here is that your GUIs have not finished moving before you make them move again. e.g.

button:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "In", "Linear", 2) -- this makes button move for 2 seconds
-- but i try to make it move again before it finishes moving
wait(1.5) 
-- this will NOT work because the previous tween hasn't finished
button:TweenPosition(UDim2.new(0, 0, 0, 0), "In", "Linear", 1) 

You can fix this by simply setting the override argument to true. When override is set to true, other TweenPositions can override the current tween that is playing. The override argument is after the time argument. Here's an example code:

button:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "In", "Linear", 2, true)
wait(1.5) 
button:TweenPosition(UDim2.new(0, 0, 0, 0), "In", "Linear", 1) 

So just add true after the time in each of your TweenPosition functions and it should work.

Hope this helps.

Ad

Answer this question