Issue with tween script (local)

I got a script:

local folder = script.Parent.Parent.TypesOfShop
local popup = folder.Spendoins
local frame = script.Parent.Parent

script.Parent.MouseButton1Down:Connect(function()
	frame:TweenPosition(UDim2.new(1.5,0,0.5,0), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, 2)
	wait(3)
	popup:TweenPosition(UDim2.new(0.5,0,0.5,0), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, 2)
	
end)

So basically, the first tween, frame:TweenPosition(UDim2.new(1.5,0,0.5,0), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, 2) works fine. It slides off, but after the wait(3), that tween does not do anything. Any help is appreciated :slight_smile:

Have you checked the output yet? That is the first action you should do any time a piece of code does not work.

1 Like

Where is popup located and are you sure that it is visible, mind showing your explorer?

No output. nothing there except for a print in another script

Its visible. Popup is a frame, in a folder, in a frame, in a gui.

Screenshot 2021-03-21 174321

Local folder is the folder called ‘Types of shop’
popup is Spendoins (Sorry I spelt coin wrong)
frame is the frame called main.

Does Spendoins already have the position (or close) to 0.5, 0, 0, .5, 0?

Its at 2.5,0,0.5,0. So basically its supposed to slide to the middle, 0.5,0,0.5,0 but it isnt

Is the popup in the frame? It could be since you’re moving the frame first which moves it and the children of it, and then it tries to move the popup relative to the position of the frame. Maybe try to unparent the popup from the frame?

1 Like

I know this is unrelated, but you know how in blender when you make stuff bigger, it expands from both sides? How do I do that on roblox?

I dont know if this works on parts, but you can hold ctrl and drag it on an axis. Also, perhaps try what I had mentioned?

Yep, control worked. I saw what you posted, Ill get back to you when I do it, because I am currently building something else than that,

1 Like

Alright, good luck with whatever you’re building!

1 Like

if you hold ctrl it works but this only works on parts and meshes. Unions and Models will only get bigger on all axis

1 Like

Hi there, try this:

.5, - 50,
.5, - 50

That is robloxs centre UI position.

I use 0.5,0,0.5,0 with 0.5,0.5 anchorpoint. I am not using offset due to it not being good on other peoples devices :slight_smile:

i didnt get to do it yesterday, but this afternoon ill get to it :slight_smile:

1 Like

Trying it now :slight_smile: Hope it works!

1 Like

Worked! Thanks to everyone! :slight_smile: