Open the propertys tab and set the “Size” property of the textlabel’s parents to {1, 0, 1, 0}, and the parent of the textlabel’s parent, and the parent of that too…till you reach startergui or playergui.
Then maybe put it in another GUI object that you can afford to be sized to full screen, and fix all the hierarchy changes in your scripts.
And if you don’t want to do that either, just put a useless empty GUI object that you are not going to do anything to, and size it to be full screen, and then replace your code with this:
local uselessGUI = Blablablawhereveryouputit
con = mouse.Move:Connect(function()
local screenSize = uselessGUI.AbsoluteSize
local scaleX = (mouse.X / workspace.CurrentCamera.ViewportSize.X)
local scaleY = (mouse.Y / workspace.CurrentCamera.ViewportSize.Y)
label.Position = UDim2.new(0, scaleX * screenSize.X, 0, scaleY * screenSize.Y)
end)
Hope this helped!
Edit: Changed code to be compliant with varying screen sizes during a session(such as when window is restored down)