UDim2 to Vector3 Conversion Matrix

Because there is a screen space module that already exists, and I needed this module for personal uses anyways, I decided to make a publicly available SurfaceGui UDim2 to Vector3 conversion matrix. This uses basic algebra to convert and if there are any ways to make this more efficient, send me a message. Enjoy:

Note: CFrame Conversion is EXPERIMENTAL


--part - The object that has your SurfaceGui.
--guiObj - The SurfaceGui frame, textlabel, textbutton, etc. you want converted.
--type - May reference "v3" for Vector3 return or "cf" for CFrame return.

Advisory: Due to floating point values been wonky, there are slight inaccuracies that should NOT affect your work unless you require exact precision. If you fit into that category, I strongly recommend you manually measure out the Vector3 positions of your gui objects.


I’m interested in this! I’ll try this when I get home!

1 Like