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 (29 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,875 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

Just thinking, you could perhaps keep a tab on each button's pressed state instead, if its 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 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.