Using the PlayerMouse
Object from a GetMouse
method of a Player:
3 | local mouse = game.Players.LocalPlayer:GetMouse() |
4 | local screenSize = Vector 2. new(mouse.ViewSizeX, mouse.ViewSizeY) |
Although this won't be accurate if the user resizes their screen, so:
03 | local mouse = game.Players.LocalPlayer:GetMouse() |
04 | local screenSize = Vector 2. new(mouse.ViewSizeX, mouse.ViewSizeY) |
06 | game:GetService( "RunService" ).RenderStepped:connect( function () |
07 | local newSize = Vector 2. new(mouse.ViewSizeX, mouse.ViewSizeY) |
08 | if newSize ~ = screenSize then |