So I'm trying to make a GUI follow the Player's mouse. Here's a script I've Tried (LocalScript inside the GUI)
Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()
while wait() do
script.Parent.Position = UDim2.new(0,Mouse.X,0,Mouse.Y)
end
The problem is everytime I re-size the screen the GUI keeps moving from the mouse. So I tried doing moving the GUI with Scale instead of the Offset, but the GUI pretty much disappears when I do that. How could I fix this problem?

3 comments
the ui dissapears when you do that, because mouse doesnt hav a scale, only an offset, and since scale takes small numbers and offset does big ones, its making it really far away
and what do you mean exactly by re-sizing screen? i did that and it still worked
Like for example, changing the screen resolution, or even when I hide my explorer and properties tab. It re-sizing my screen and the GUI is not where it was when I had the explorer and properties tabs open.