0 votes

Hi, I want to make a quick menu that's accessible during gameplay and can be enabled while holding a key, so the player can select an item with the arrows. Then on release, the item gets selected.

A little gif showing the intended result:

selectable items menu

Now, I've tried with ItemList, and with an HBoxContainer with buttons and adding focus logic, but it lead to unintended results.

I'm completely lost in what should I do, if someone can point me in the right direction, it'd be really appreciated.

asked Jan 13 in Projects by jevisan (12 points)

If I get you rigth the player should push a certain key and a menu will show? like

var Item : String = ""
if Input.is_key_pressed(KEY_0):
  $PathToNode.show()
else:
   $PathToNode.hide()
if $PathToNode.visible:
  if Input.is_key_pressed(KEY_LEFT):
     $PathToNode.PathToItem.set_texture(ItemSelceted)
     Item = "Item01"
  else:
    $PathToNode.PathToItem.set_texture(NoItemSelceted)
    Item = "No Item"

Like this?

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 How to use this Q&A? before posting your first questions.