GUI Position not updating when a GUI is moved in game

Sorry, I couldn’t get a picture of the actual gui that should be moved, but gyazo fires the mouseleave event when I open it, so the gui would disappear.

In short, the gui position doesn’t update from in studio placement to when I move it using a tween in game. If anyone knows any workarounds for this please tell me. I’m trying to place a gui over another one, without creating 20+ copies of the gui manually placed over each one.

It’s hard to find the problem without seeing the code.

I’m asking general case workaround. There shouldn’t be a need to see the code. To clarify the question: when in game, tweening the position of a GUI object, the position doesn’t update. Even though the GUI moved, the position property is still the same. If you know any work around for getting the updated position please tell me. Thank you so much for the help and the fast response time!

The reason I wanted to see your code is because when you tween a gui object the position does update:

Code I used in my test:

local gui = script.Parent
local frame = gui:WaitForChild("Frame")

local gp = UDim2.new(1, 0, 1, 0)
frame:TweenPosition(gp, Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 5)

while true do
	print(frame.Position)
	wait(0.1)
end

Screenshot of the output from my test:

image

Video of my test:
https://gyazo.com/054ee91eda0b0585b2f1f5c9358bd661

2 Likes

Thank you for the help! Apparently the position only updates when using TweenPosition. I was using TweenService:Create(). I had completely forgotten about TweenPosition. Thank you!

1 Like

Are you sure you put :Play() at the end?
you probably did:

TS:Create()

You forgot to add :Play()

TS:Create():Play()

It’s advised to use TweenService because it is so much better.

Yes, I did use TS:Play(), but tween service does not update the position of the gui the way TweenPosition does. It will show the GUI moved, but it won’t update the position property.