Hello! Been designing UI for my game, and I do want it to be more friendly for console players, but at least to me the UI Navigation for when you press the select or backslash button seems to have a mind of its own when it navigates UI.
Is there a way to replace this system with one I make myself? Can I retain the backslash/select button key bind to it as well?
Both questions are possible.
Here’s a little sample where you can script what happens when say a player presses ButtonA
.
local GuiService = game:GetService("GuiService")
local UserInputService = game:GetService("UserInputService")
-- Disable default Gamepad Nav system.
GuiService.GamepadNavigationEnabled = false
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if input.UserInputType == Enum.UserInputType.Gamepad1 then -- Check for Gamepad1
if input.KeyCode == Enum.KeyCode.ButtonA then
print("ButtonA has been pressed.")
--some logic
elseif input.KeyCode == Enum.KeyCode.ButtonB then
print("ButtonB has been pressed.")
--some more logic
end
end
end)
You can use ContextActionService:BindAction()
to get any input and change it.
Only thing is you’ll have to implement your own navigation logic, (and not pretending I know this) but that sounds pretty hard.
1 Like
I can’t believe I never heard of GuiService?? Thanks a ton though!
The navigation logic I have in mind though is actually really simple though. I was just thinking of assigning each select-able element 4 other elements to move to according to each of the 4 D-Pad directions.
1 Like