I’m trying to create a joystick type thing and ran into this weird offset error. I’m not sure what caused this and what attempts I can make to try to fix it.
Code
A UDim2 value holds 4 coordinate positions (scale and offset) used for 2D coordinating.
since you’re initially setting the scale of each position to 0.5, the joystick position will start at (0.5, 0.5) on the x-y axis, and then add the additional math.clamp values to the offset as shown.
you would need to clamp a negative version of the radius AND a positive version of the radius. for example:
Go to the GUI and go to size. Then open the X and Y. After that change both offsets to 0. Then you can mess with the Y scaling. Setting the offset to 0 will make it fit any device. Than when you scale it with the Y scale it should fit anywhere you want it. Here is an example I used in my game: