Getting relative position from absolute position

Hello! I want to get the relative position (that number that goes from 0 to 1) of my mouse within a frame. How can I do it?

I am currently trying to transform an absolute position to a relative one, because frame.MouseMoved returns an absolute position in its X and Y parameters.

Help, please.

2 Likes

You could use this to find the elements below your mouse position:

local under = playerGui:GetGuiObjectsAtPosition(pos.X, pos.Y)

If the frame you are after is in there, take the frame’s absolute position and subtract it from the mouses absolute position.