- Home /
How to make a local multiplayer game? With one device as input.
Hi everyone,
I have been working on a car game with local multiplayer. I was reading a lot and came across the new input system in Unity, however all tutorials(blogs, youtube videos etc.) do not cover how to make local multiplayer with one device or even with the same device(at least only with keyboard). So my question to you is how do I achieve local multiplayer with one keyboard.
If you don't have the time to explain it to me, could you please link a blog post or anything of that nature witch covers this topic. (I found this blog "https://medium.com/@gb6d/two-players-one-keyboard-how-to-enable-multiple-players-in-the-same-device-with-unity-cd57853edc3f" but the explanation is not very clear if you don't have the time and this is the blog you were going to recommend me please explain what is happening there). Thank you in advance.
A simple suggestion would be to add Horizontal1, Horizontal2, etc. to the input manager. The Horizontal1 would have "a" and "d" as inputs, the Horizontal2 would use the arrow keys and so on.
In your script you'd call the inputs with a "1" for player 1 and "2" for player 2.
I have tried this but it doesn't work for me. Its strange I know if I would use this method and lets say I press 2 buttons at the same time the other ones just stop working for some reason. If there is a way to get over this please tell me.
Unfortunately, there seems to be a limit of simultaneous inputs on a keyboard.