Hello devforum, so basically in the past few days I’ve been making an IFE, in which i have some unique ideas for it, like an IFE remote using NextSelection.
I did got it to work, referenced from GuiObject.NextSelectionUp (roblox.com)
This is the picture of the GUI I made, so basically I wanted to make the NextSelection work using my GUI buttons on the remote control, I tried using MouseButton1Down on the buttons, but it still only works using WASD or arrow keys, is it actually possible to do so using a GUI buttons?
1 Like
Have you named your UI elements 1, 2, 3, etc. and set the UIGridLayout sort to SortOrder|name?
I have, I used that method by roblox and it works using WASD, its just that when i try to use the buttons its not possible
If the UI layout is single row grid layour as shown in your screenshot, then I would roughly do the following:
Create a variable containing all the elements. These are now indexable. If you know the start position is element 1, then your button.Activated event just updates the chosen element:
local UIelements = parentFrame:GetChidren()
local selected = 1
rightButton.Activated:Connect(function()
UIelements[selected].Border = 0 -- assuming you highlight with the border, so turn off on previous
selected += 1
UIelements[selected].Border = 5 -- so turn on new selection)
-- rinse and repeat for the other directions. Add logic to capture when on first & last selection
If the grid is 2D, ie rows and columns someone else might be able to advise. There might even be a better way to achieve the above that I am not aware of.
Thanks for the idea you gave me, but the borders already came with NextSelectionUp, when you code it, the border automatically appears, it was designed for console and keyboard control, I wanted to make so that the button works just like the keyboard. But your code is a great alternative, and probably will refrence to it since manually doing so with an image border is an easier idea, thanks for helping me!