Why is my gui going to the wrong place?

For some reason, my gui keeps going to the wrong position even though it should be correct.
Script:
local PlayFrame = script.Parent.Parent.Parent.PlayFrame
local CreateFrame = script.Parent.Parent.Parent.FrameOutline.CreateFrame
local FrameOutline = script.Parent.Parent.Parent.FrameOutline

script.Parent.MouseButton1Click:Connect(function()

if FrameOutline.Position == UDim2.new(0.5, 0, 0.5, 0) then
	FrameOutline:TweenPosition(UDim2.new(0.5, 0, 2, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 1)
else
	FrameOutline:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 1)
end

if CreateFrame.Visible == true then
	CreateFrame.Visible = false
end

end)

script.Parent.MouseEnter:Connect(function()
PlayFrame:TweenPosition(UDim2.new(0, 0.92, 0, 0.135), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0, true)
end)

How it should be:


(Sorry the box got cut out)

How it is:

Please help, and have a great day.

Did you mean to Tween the Scale property instead?

PlayFrame:TweenPosition(UDim2.new(0.92, 0, 0.135, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0, true)
1 Like

Yes that’s what I mean__________.

You could just experiment and keep changing the Positions a bit, then hopefully the Tween should end up where you want it to be?

1 Like

Even when I do the different positions it keeps placing it at the same spot.

Are you using any UIConstraint objects that may prevent the UI from getting tweened to that certain position?

1 Like

No, I’m not. I have no idea what the problem is.


Here is an image of my guis.

Could you show the properties of the FrameOutline object?

1 Like

try setting the play button’s position to {0,0,0} (not in the script in the properties of play)

1 Like

but did you set this?? Did it work??

1 Like

okay so i just noticed that the photo where the photo is taken is from a mobile…? does this problem also happen on pc? when does the gui go to the top right? (my best guess it goes right because the position was set to 0,0,0,0) i think it is being set to 0,0,0,0 becuase of the this code line;

did you change that line to what @JackscarIitt suggested;

since the position x and y of the offset does not allow any decimal numbers. my best guess since your putting decimals in the offsets position it automatically sets it to 0,0,0,0

2 Likes

Can you change Enum.EasingStyle.Quint to Enum.EasingStyle.Linear ? I remember there being an issue with Gui:TweenPosition where the object would be moved to position 0,0 when using EasingStyles that were not Linear.

1 Like