How to align frame to player's mouse (With auto-offset, because constant offset is not enough)

I couldn’t find how to fix this, either I have not searched enough

My frame anchor point is 0.5, 0.5

Currently I’m using constant offset which is 0.2 for pc and 0.22 for mobile
But based off screen resolution, it will not align perfectly enough if its too high

image

I also have thing to automatically offset frame if its offscreen which works and which I asked help with on dev forum
image

image

I do need help to align frame perfectly at mouse

With closed output:
image

With opened output at almost 1/4 of screen I think:
image

Not sure if I’m understanding what you’re trying to do fully, but it sounds like you want the frame a certain offset from the mouse yet that offset is currently scaling with screen resolution?

If so, then you’ll want to use the ‘offset’ values of the UDim2 instead of the ‘scale’ values:

InfoFrame.Position = UDim2.new(0, MyMouse.X +XOffset, 0, MyMouse.Y +YOffset)

The ‘scale’ components are measured as a ratio of screen size, so will increase as the screen size increases. ‘Offset’ components are set pixel-lengths, and will not change as the screen size increases.

Not sure if this is what you mean, or what you’re trying to achieve fully. If this isn’t the issue then please provide a bit more information about exactly what you’re trying to achieve.

the YOffset and XOffset is < 1 for a reason

You can see problem on screenshots
Its not* scaling with resolution