GamepadService
The GamepadService is internally responsible for handling inputs from various controllers, such as Xbox One or PlayStation DualShock controllers.
Memory category | Instances |
---|
Member index 6
Description
The GamepadService is internally responsible for handling inputs from various
controllers, such as Xbox One or PlayStation DualShock controllers. It also
handles APIs used with the gamepad virtual cursor. You can enable the gamepad
cursor for your experience by setting VirtualCursorMode under
StarterGui to Enabled
.
History 21
- 573 Change ReturnType of SetGamepadCursorPosition from void to null
- 573 Change ReturnType of EnableGamepadCursor from void to null
- 573 Change ReturnType of DisableGamepadCursor from void to null
- 553 Change Default of GamepadCursorEnabled from to false
- 512 Add EnableGamepadCursor
- 512 Add DisableGamepadCursor
- 512 Change CanLoad of GamepadCursorEnabled from false to true
- 512 Change Tags of GamepadCursorEnabled from [Hidden, NotReplicated] to []
- 512 Change Category of GamepadCursorEnabled from State to Data
- 512 Change CanSave of GamepadCursorEnabled from false to true
- 512 Change ReadSecurity of GamepadCursorEnabled from RobloxScriptSecurity to None
- 504 Change Tags of GamepadService from [NotCreatable, Service] to [NotCreatable, Service, NotReplicated]
- 499 Add GamepadThumbstick1Changed
- 486 Change ThreadSafety of GamepadCursorEnabled from ReadOnly to ReadSafe
- 462 Change ThreadSafety of SetGamepadCursorPosition from to Unsafe
- 462 Change ThreadSafety of GetGamepadCursorPosition from to Unsafe
- 462 Change ThreadSafety of GamepadCursorEnabled from to ReadOnly
- 451 Add SetGamepadCursorPosition
- 451 Add GetGamepadCursorPosition
- 451 Add GamepadCursorEnabled
- 185 Add GamepadService
Members 6
DisableGamepadCursor
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
null |
This function disables the gamepad cursor, if it's currently enabled.
Thread safety | Unsafe |
---|
History 2
- 573 Change ReturnType of DisableGamepadCursor from void to null
- 512 Add DisableGamepadCursor
EnableGamepadCursor
Parameters (1) | ||
---|---|---|
guiObject | Instance | |
Returns (1) | ||
null |
This function enables the gamepad cursor if it's currently disabled. If
the cursor is already enabled, calling the API updates the cursor's
position. The function accepts a GuiObject parameter,
but there are some invalid cases. Please note that in order to set the
cursor to the default position, nil
must be passed in as a parameter.
Providing no argument will result in an error.
Input GuiObject | Cursor Starting Position | |
---|---|---|
Nil | Default position | |
Not a GuiObject | Cursor does not appear, errors | |
Not a child of BasePlayerGui | Cursor does not appear, errors | |
GuiObject has Visible 2 set to false or any parent visible set to false | Default position with warning | |
Child of ScreenGui 1 with Enabled 1 set to false | Default position with warning | |
Child of BillboardGui 4 or SurfaceGui | Default position with warning | |
GuiObject outside the viewport (Or, any part of the gui object that is off screen) | Default position with warning | |
Child of ScrollingFrame with clipping set to false: GuiObject outside of scrolling frame (Object child of scrolling frame and not visible on screen) | Default position with warning | |
Child of ScrollingFrame with clipping set to true: GuiObject outside scrolling frame window but inside viewport | GuiObject moves into the scrolling frame and starts the cursor centered over the object | |
GuiObject inside the frame and visible | Cursor starts centered on the GuiObject |
Thread safety | Unsafe |
---|
History 2
- 573 Change ReturnType of EnableGamepadCursor from void to null
- 512 Add EnableGamepadCursor
GamepadCursorEnabled
Type | Default | |
---|---|---|
bool | false |
This boolean is a read only variable that maintains the state of the gamepad virtual cursor.
Write security | RobloxScriptSecurity |
---|---|
Thread safety | ReadSafe |
Category | Data |
Loaded/Saved | true |
History 9
- 553 Change Default of GamepadCursorEnabled from to false
- 512 Change CanLoad of GamepadCursorEnabled from false to true
- 512 Change Tags of GamepadCursorEnabled from [Hidden, NotReplicated] to []
- 512 Change Category of GamepadCursorEnabled from State to Data
- 512 Change CanSave of GamepadCursorEnabled from false to true
- 512 Change ReadSecurity of GamepadCursorEnabled from RobloxScriptSecurity to None
- 486 Change ThreadSafety of GamepadCursorEnabled from ReadOnly to ReadSafe
- 462 Change ThreadSafety of GamepadCursorEnabled from to ReadOnly
- 451 Add GamepadCursorEnabled
GamepadThumbstick1Changed
Parameters (1) | |
---|---|
event | Vector2 |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
GetGamepadCursorPosition
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Vector2 |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 462 Change ThreadSafety of GetGamepadCursorPosition from to Unsafe
- 451 Add GetGamepadCursorPosition
SetGamepadCursorPosition
Parameters (1) | ||
---|---|---|
position | Vector2 | |
Returns (1) | ||
null |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 3
- 573 Change ReturnType of SetGamepadCursorPosition from void to null
- 462 Change ThreadSafety of SetGamepadCursorPosition from to Unsafe
- 451 Add SetGamepadCursorPosition