0 votes

So I've been fiddling with this, but I just cannot figure it out.
I want to do the typical options menu for changing controls: select an action from the list (for example 'JUMP'), a 'please press the key' pop-up appears (or not, doesn't matter) and the next key you press gets saved as the input for that action. Could someone provide me with a snippet of example code or just explain thoroughly how to do this (as in just catching the input event part)?

Also, I'd like to save this configuration to a file and be able to load it later on. Again, I'm not quite sure what to save here, especially that I'd like this to also support gamepads.

asked Jan 24 in Engine by Elkondo (32 points)

1 Answer

+1 vote
Best answer

Godot's inputs usually use the input map. there are other ways to use inputs but the input map is the best. here is a tutorial on the input map: https://www.youtube.com/watch?v=OOnm32Uad0g

answered Jan 24 by Gold Card (53 points)
selected Jan 25 by Elkondo

Yes, my point was how to change the input map in-code, as in read the raw InputEvent and set it as the event which triggers InputMap action.

I kinda figured it out, though I do have some other related issues I'm working on. Might post a tutorial on the forum when I'm done.

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.