This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

What we have

  • Player in Spleet Screen game (one pc multiplayer).
  • Individual Consoles for Players

Console opens ui menu for Player.

enter image description here

1. How to set individual input map for ui menu and control him ?
2. How to controll menus (individual ui node) from Player Gamepad?

ps. need i create custom input system for that? or i can change default ui inputs and set players gamepad inputs map?

Godot version 3.5
in Engine by (12 points)
edited by

For now my solution is:
1. Created an Array of UI elements and set the grab_focus() method.
2. Listening for input from a player controller.
3. Setting a new focus for an element based on the key pressed

var conroller := "_joy0" # it's doesn't matter for now

func _unhandled_input(event: InputEvent) -> void:
if menu_is_opened and event is InputEventJoypadButton:
    if Input.is_action_just_pressed("down%s"%conroller):
        get_focus_owner().find_next_valid_focus().grab_focus()
    if Input.is_action_just_pressed("up%s"%conroller):
        get_focus_owner().find_prev_valid_focus().grab_focus()

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.