RockyRosso
(RockyRosso)
September 29, 2020, 1:23pm
1
So, I wanted to make a gui tween up and the problem is that, when I wrote the code for the button, the gui didn’t tween at all. And I’ve used this code many times before. Here’s the code:
script.Parent.MouseButton1Click:Connect(function(clicked)
script.Parent.Parent.Parent.level1:TweenPosition(UDim2.new(0, 0,-5, 0))
end)
1 Like
For tween position you would need
:TweenPosition(Position, Direction, EasingStyle, Time)
You only filled one of them
Also check if there is any errors in the output.
1 Like
RockyRosso
(RockyRosso)
September 29, 2020, 1:28pm
3
I checked the output and there were no errors.
angrybino
(angrybino)
September 29, 2020, 1:29pm
4
They don’t necessarily have to error, you need to pass the arguments.
RockyRosso
(RockyRosso)
September 29, 2020, 1:31pm
5
I tried and it still doesn’t tween.
In your :TweenPosition you’re tweening the UI to the bottom, does it disappear? It might be tweening to fast because you didn’t fill the time.
RockyRosso
(RockyRosso)
September 29, 2020, 1:34pm
7
No, I’m trying to tween it up. And no, it doesn’t disappear, it just does nothing.
Make sure you’re not tweening a screen gui. Also instead of MouseButton1Click you should do .Activated instead
script.Parent.Parent.Parent.level1:TweenPosition(UDim2.new(0, 0,-5, 0), "Out", "Quart", 1)
Try this
RockyRosso
(RockyRosso)
September 29, 2020, 1:37pm
9
I tried it and it still does nothing. Did roblox just break the code?
Is that all of the code in the script? Make sure it’s a local script.
RockyRosso
(RockyRosso)
September 29, 2020, 1:39pm
11
It’s in a local script. I always put gui code into a local script.
Is there any wait(), or any loops in the local script? If not I can’t think of a solution
RockyRosso
(RockyRosso)
September 29, 2020, 1:40pm
13
Nope no loops and no waits. I think Roblox might have just broken the code. Cause I always use this code and it always works.
1 Like
RockyRosso
(RockyRosso)
September 29, 2020, 1:42pm
14
Ok so I just found out that for some reason, the code doesn’t work in studio but it works in game. Man, Roblox is broken sometimes.
hakobmher
(Hak)
September 29, 2020, 1:43pm
15
Put this in your Button make sure its TextButton add Local Script in it and use
script
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Parent.level1:TweenPosition(UDim2.new(0, 0,-5, 0),“Out”,“Quad”,0.5)
end)
These scripts arent supposed to work in studio…
At least you solved your issue
RockyRosso
(RockyRosso)
September 29, 2020, 1:44pm
17
But they should work in play test mode.