0 votes

I'm trying to add a menu for redefining the keys for my game, and found this documents page that gives me code for that, however, it doesn't work...

Here is my code:

func _input(event):
if buttonPressable:
    if takingInputs:
        if event.type == InputEvent.KEY:
            event.type = InputEvent.ACTION
            event.set_as_action(action, true)
            takingInputs = false
            buttonPressed = false
            buttonPressable = false
            option.reshowItem(str(key))
            hide()

What am I doing wrong?

in Engine by (171 points)

1 Answer

0 votes
Best answer

Nevermind, I figured it out, I followed this source code and that worked for me: https://github.com/akien-mga/dynadungeons/blob/master/scripts/controls.gd

by (171 points)
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.