I made this in one sitting last night to help make my game more xbox-friendly. You simply just drop it into the StarterGui and then when the player presses select it disables their controls (you must be using the new PlayerScripts layout) & puts a cursor in the middle of the screen which can then be moved around with the left trigger. When it’s hovering over a TextButton, ImageButton, or TextBox it sets GuiService.SelectedObject to that UI. You can then press A and it will click it. This is compatible with MouseButton1Click and Activated and nothing should have to be changed within your UIs.
I have noticed that this can get a little bit laggy with a ton of selectable buttons, however I tried to fix that today by not running collision calculations for UIs that aren’t visible. If you find any more problems or have an easier, less-laggy way to do this please let me know.
UPDATE 07/05/2019
I’ve made some changes to the way that the UI selector works, thanks to some suggestions from @goreacraft! If you’re currently using this in your game I would suggest you update to the newest version as it will be much less laggier if you have tons of UIs in your game!
UPDATE 01/08/2023
I noticed that this is still getting likes, so I figured I would update this post and let you know that this has officially been deprecated. It still works as far as I know, but it will no longer be updated or supported. If you’re looking for a cursor for XBOX, Roblox has now released an official one here: Gamepad Virtual Cursor - Studio Beta
The category he posted doesn’t link to tutorials, it links to Community Resources. Community Resources is a public subcategory of Learning Resources where both members and non-members can view your items and take them or experiment with what you post. Cool Creations is for showing off your works but only members can see the thread. If you’re looking to share a model, you should move it to the category he linked. If not, it’s fine here.
Just spent 3+ hours fixing tons of bugs with this system that players in my game have been reporting. This now supports ScrollingFrames, takes into account ClipsDescendants, and I applied TONS of performance fixes. If you use this let me know what you think!
i tried your solution and it fails to detect some buttons i add by scripts, i don’t know why.
i will try and make a version with your cursor movement part in combination with GetGuiObjectsAtPosition
Thank you for your share, as it helped a lot
Do you think it is possible for the cursor to detect backack gui frames too? as the cursor just goes under any gui from default roblox inventory ( i think it is not possible as they are part of CoreGui)
i think the proper way to disable and enable the mouse is require(player.PlayerScripts.PlayerModule):GetControls():Disable() not require(player.PlayerScripts.PlayerModule.ControlModule):Disable(), i am not entirely sure about this one, but i thought i might share this to you
This is a great tool and I have been using it for a few months now. I just ran into a problem where I put it in a shared package and now when the player resets his character, they can’t move until I hit select and then hit select again. If I remove it from the package it works fine. The package adds another parent on top of the screen, but there doesn’t seem to be anything in the scripts that would care about that. Any ideas?
Hmm, It’s possible that instead of player.PlayerGui I set it to search the descendants of “script.Parent.Parent”. I can’t confirm, however, if that’s true because I haven’t really touched this code much since the last time I posted that I updated it. I can look at it tomorrow if I remember and let you know.
As a temporary workaround you can run this code in a Local Script when the player respawns: require(player.PlayerScripts.PlayerModule.ControlModule):Enable()
This is really cool. I’m currently tweaking it a little bit, is it ok if I upload my tweaked version to Resources - DevForum | Roblox? Of course, I would credit you.