function GetCorner(sz, pos, anch)
pos = typeof(pos) == 'UDim2' and Vector2.new(pos.X.Offset, pos.Y.Offset) or pos
anch = anch or Vector2.new(0,0)
return pos+(sz*anch)
end
while wait() do
local obj = script.Parent
local Corner = GetCorner(obj.AbsoluteSize, obj.Position, obj.AnchorPoint)
local Center = Corner+(obj.AbsoluteSize/2)
script.Parent.Parent.Center.Position = UDim2.fromOffset(Center.X,Center.Y)
end
Code
So as the title says I need to get the center point of a UI but the script dosent even work idk why now I took it from devfroum so it should work but na it dosent so can someone help me in it?