We are excited to bring you the Gamepad Virtual Cursor! It is a mouse-emulation cursor for gamepad input, used for interaction with game user interface (UI) that were not necessarily designed or customized for gamepad navigation. Currently, the default is off, so you would need to enable this in your game if you’d like to use this feature.
We wanted to provide a solution that works for all types of UI layouts automatically, especially when it was primarily designed for a mouse cursor. This led us to build a mouse-like cursor for gamepads that provides easier UI navigation across all Roblox games. This also unlocks gamepad UI support for games that are menu-heavy, that did not previously work with gamepads at all!
Previous Studio Beta Post:
The Virtual Cursor was previously available in Studio Beta and now we have fully released it as an “opt-in” feature, so you can enable it in your game if you want to try it out. If this is determined to be a better solution for gamepad UI control, we will consider making this the default going forward, so please give us your feedback!
We have introduced a new property on StarterGui called
VirtualCursorMode, as a method to opt-in to this feature.
This property includes 3 settings:
- Disabled - turns off the virtual cursor and uses the current UI navigation behavior
- Enabled - turns on the Virtual cursor
- Default - this is currently set as “Disabled”
Set the Virtual Cursor “Enabled” to allow your players to use this feature. We suggest testing this out in the event we potentially move to this system as the default for UI navigation.
The Gamepad Virtual Cursor will work in any Roblox place, unless custom gamepad navigation controls have been set up. Use the left thumbstick to move the cursor around the screen to highlight UI buttons/menus. Triggering the UI button is the same as before - simply press the A Button to trigger or interact with the highlighted UI element.
The Virtual Cursor selects the closest GUI button (TextButton or ImageButton) with the highest ZIndex. Virtual Cursor will ignore objects with Selectable set to false or Active set to false. If the cursor is hovering over several UI objects, the object that is closest to the center of the cursor will be highlighted.
You may also notice that the cursor will automatically slow down when it hovers over an interactable UI element. We did this to reduce the chance of a player accidentally scrolling past the UI element. Once the cursor moves off of the UI element it will return to full scrolling speed.
The Virtual Cursor essentially acts like a mouse for certain events. You will be able to listen to MouseEnter, MouseMoved, and MouseLeave events as well as the mouse position using GetMouseLocation for the virtual cursor - just as if the player was using a mouse
If you already set up custom gamepad menus and navigation, you are awesome! We suggest you review the functionality of the virtual cursor and decide whether you want to keep your custom controls or use the new system. After reviewing, if you would like to keep your custom solution, the virtual cursor can be disabled.
For example insert a LocalScript in StarterPlayer/StarterPlayerScripts with this code
-- Only use this if you do not want virtual cursor in your game! local guiService = game:GetService("GuiService") guiService.AutoSelectGuiEnabled = false
In addition, bind over view button, some other button to start UI selection.
If you hover over a GUI button that you expect to be highlighted but it is not, make sure the button property Selectable is set to true.
If you bind the view button (or equivalent button) to start UI mode but do not set AutoSelectGuiEnabled to false, you will get both the virtual cursor and the old UI selection system. Try not setting an initial SelectedObject and let virtual cursor handle the navigation! Or, if you want to keep your current navigation, simply set AutoSelectGuiEnabled to false.
In addition, you will need to disable the virtual cursor if you are using the view button for a custom bound special action or functionality. If you do not set AutoSelectGuiEnabled to false, the virtual cursor will be active.
Fix is shipping soon
- Selecting a Tool from the Toolbar does not equip it (shoulder buttons to equip/switch works as expected)
- Hovering over a Proximity Prompt with VC and pressing A won’t activate it (pressing the gamepad button displayed on the prompt works)
- Emotes from the emotes menu can only be selected when the Virtual Cursor is toggled off. If you toggle the VC on, you’ll have to toggle it back off to select an emote
- Clicking and dragging a UI element is not currently supported
- Unable to scroll up or down in scrolling frames (we are considering use of the d-pad to scroll, when a scrolling frame is highlighted)
- BillboardGui or SurfaceGui interaction is not currently supported
- TextBox interactions are not currently supported but we are actively looking at solutions
Let us know what you think (the good and the bad)! If you run into issues with this feature in your game, please reply with the details in this post. Also, if you enable virtual cursor in your experience, please leave a link to it below! The feedback will help us continually improve this feature. If you are running into issues, please let us know! We will actively work with developers to ensure this feature can work well in their experiences. Thanks.