+2 votes

Hello everyone. I'm trying to make a local multiplayer game using Godot 3.4.2 stable. I have two characters and they will try to kill each other. The characters will be controlled by two players using two different keyboards but they will use the same inputs.

For example, suppose, A and B are the characters of my game. When Player 1 presses W, only A will move forward. Similarly, when Player 2 presses W, only B will move forward. I've saw a discussion talking about the same issue, but I didn't quite catch the answer. Here's the link.

https://godotengine.org/qa/78584/how-to-implement-local-multiplayer

Does anyone know how to do it? Is there any way to do it? Thank you in advance.

[N.B: I don't have any gamepads, just two keyboards.]

in Engine by (132 points)
edited by

1 Answer

0 votes

I don't think this is possible - even at the OS level (for Windows anyway). While you can connect (and use) multiple keyboards at the same time in Windows, I don't think there's any way to differentiate between them. So, pressing "Z" on one keyboard (for example) would be the same as pressing "Z" on the other keyboard.

Also, looking at Godot's input map, keyboard input doesn't have a Device number, unlike some other input types. That's used to differentiate the input of multiple, similar input devices (like 2 game controllers for example).

by (12,473 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 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.