How can I see the players screen size using ViewportSize? Also, how do I use ViewportSize?
If you would like to obtain the dimensions of the players screen using ViewSize
in a local script
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local mouseScreenSize = Vector2.new(mouse.ViewSizeX, mouse.ViewSizeY)
print(mouseScreenSize)
you may also wish to use viewportsize, a seperate property of the camera
local camera = workspace.CurrentCamera
local cameraScreenSize = camera.ViewportSize
print("cameraScreenSize: ", cameraScreenSize)
How would i see if its smaller than 852x414?
The code below checks if either axis is below its minimum, if so it will run whatever code you put within it.
local Mouse = game:GetService('Players').LocalPlayer:GetMouse()
if (Mouse.ViewSizeX < 852) or (Mouse.ViewSizeY < 414) then
--// Your Code Here
end