I understand that you can access the value of the size of a player's screen through ScreenGui, however is there another way of accessing a player's FULL screen size in all the values/coordinates.
For example, is there a method of accessing the value of a players FULL screen without using ScreenGui, and also containing the coordinates and axis such as X and Y scale of the player's screen
Also, I don't understand much of the UserInputService
If I wanted to make a script where for every time R was pressed, print("R was pressed") would be printed.
I tried
game:GetService("UserInputService").InputBegan:connect(function() if Enum.Keycode.R then print("R was pressed") end
-- But it doesn't work.
Could you, by chance, give me some tutorials of UserInputService which contains in inputs such as keyboard and mouse inputs. Also, could you give me some tutorials for ContentActionService
These, are the ONLY factors I am having trouble understanding in Roblox wiki.
To answer your first question:
workspace.CurrentCamera.ViewportSize
This is a Vector2 value.
As for your second question:
Your code is only slightly wrong: the UserInputService's events pass an 'InputObject' value as an argument that contains the relevant data. You're also missing an end
:
game:GetService("UserInputService").InputBegan:connect(function(inpt) if inpt.KeyCode == Enum.KeyCode.R then print("R was pressed") end end)