Converting UDim Scale to Offset

Working on a UI module for my game and i’ve hit a bit of a roadblock.

to make things as short and simple as possible, I have a UDim2 size value of a Frame object and I need to convert the Y.Scale value to Y.Offset (the equivalent of Scale but in pixels). How could this be done? can it even be done?

Yes you can, you can take the camera.ViewportSize to help you convert!

local viewSize = workspace.CurrentCamera.ViewportSize
local yScale = -- your Y.Scale value

local yOffset = viewSize.Y * yScale
1 Like

actually found a much better solution by just using the AbsoluteSize value

1 Like