How to get a position in uigridlayout?

Hello, I need help with getting the position with uigridlayout, basically I want to match the position of a frame to the position of a button within a uigridlayout but it doesn’t work, I tried using absoluteposition but it didn’t give me the correct position, here is my script can you help me: local original = variables.home.Size local abs = UDim2.new(buton.AbsolutePosition.X,0 , buton.AbsolutePosition.Y, 0) print(abs) variables.launch.Position = abs variables.launch:TweenSizeAndPosition(UDim2.new(1, 0,1, 0), UDim2.new(0.497, 0,0.5, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 0.28, true) variables.home:TweenSize(UDim2.new(0.7, 0,0.7, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 0.28, true) wait(1.3) variables.home.Visible = false variables.launch.Visible = false variables.home.Size = original app.Visible = true variables.launch.Size = UDim2.new(0, 0,0, 0)
I’m sorry if something is not understood, this is my first publication.

Hello
Absolute position is relative to the entire screen so you have to subtract the absoluteposition from the larger frame in which the frame you need the position

1 Like

I didn’t understand much, but based on the little I understood, I did this but it’s still not the position I want to achieve.
abs
absolutephone would be the largest frame

you put it in the wrong spot

a udim2 is structured like this

{percent of screen on x axis, pixels on x axis, percent of screen on y axis, pixels on y axis}

it should be

local abs = UDim2.new(0, buton.AbsolutePosition.X, 0, button.AbsolutePosition.Y)
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.