#How to grab the player screen size

1 messages · Page 1 of 1 (latest)

snow geyser
#

I want to make a system that detects which side of the physical computer widow the mouse is located.

I looked for around 30 minutes in the documentation and i could not find a service that grabs the CURRENT window size of the current player in vector2 specifically. I don't want to use 1080 p as its not the display size of every window that can be used.

I believe the way i am going about detecting the position of the mouse (UserInputService.GetMouseLocation) is not ideal for the system or could be changed, but if someone could please help by providing a better way to get mouse position (relative to the screen size) or a way to grab the current screen size itself it would be greatly appreciated.

snow geyser
snow geyser
#

camera.viewportsize returns "(1,1)" instead of the pixels of the users screen for me

#

if anyone has a solution please let me know

#

it is telling me that it uses "roblox UI offset units" and i dont know how to translate that into pixels

surreal arrow
#

i will send you a screenshot rq

snow geyser
#

👍

surreal arrow
#

for some reason

#

viewport size doesnt show the real resolution on the few first frames

#

when i used a task.wait

#

it worked

snow geyser
#

i see

obsidian briarBOT
#

studio** You are now Level 4! **studio

snow geyser
#

is this just a task.wait approach then or is there a better way before i go with it

surreal arrow
snow geyser
#

alright, thanks a lot for the help

surreal arrow
#

no problem

waxen elm
#

local size = game:GetService("UserInputService"):GetScreenSize()

#

the x and y gives the current scaled window size

#

so when u scale it and calm it again, itll get the scaled version