+3 votes

Normally I use actions for inputs from the user, but what if the user wants to rebind their controls in game (like in most PC games)? How would I go about setting that up?

in Engine by (847 points)
If @umfk's answer was correct, consider marking it as such.

2 Answers

+3 votes
Best answer

If you download the official demo folder you fill find a demo called input_mapping in the folder gui. It has a small example for how to do this.

by (372 points)
selected by
0 votes

You can find the input_mapping Godot demo project here, and the relevant code from here for the function remap_action_to(event):

InputMap.action_erase_events(action) InputMap.action_add_event(action, event)

by (72 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 webmaster@godotengine.org with your username.