0 votes

I was wondering if there was a way to make it so a Action within the Input Map is ran when two different keys are pressed at the same time?.
So like how you can make it so if you press Control+W then it'll play the Action, can you make it so if you press W+A, the action plays?

in Engine by (28 points)

1 Answer

0 votes
Best answer

Does it have to be from the input map? you could simply do this:

if Input.is_action_pressed('ui_up') and Input.is_action_pressed("ui_left"):

You can also use the Input Map and assign more than one key, but only one of the keys can be a regular one. The others have to be Shift, Control or Alt, or a combination of them. By long-pressing those keys plus another one you can assign a combination in the Input Map.

by (1,859 points)
selected by

I guess it doesn't have to be from the Input Map but I'd prefer it as It'd be easier to implement it with buttons for mobile

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.
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.