You need to consider the parent of the object’s AbsoluteSize you’re converting the values on:
function OffsetToScale(offset: Vector2, object: GuiObject): Vector2
return offset / object.Parent.AbsoluteSize
end
function ScaleToOffset(scale: Vector2, object: GuiObject): Vector2
return scale * object.Parent.AbsoluteSize
end
If you’re working with LayerContainer objects, like ScreenGuis, as the parent of the object you’re converting the values on, then these do inherit the AbsoluteSize property from the GuiBase2d class. For a ScreenGui specifically, the AbsoluteSize of it is your viewport’s size