How I can connect mobile devices?

I am trying to make a game for local co-op game.
The idea is to make a pc game where 2 players can use their mobile devices (Smartphone, tablet) as controllers for the game. The smartphones will connect with Bluetooth or wi-fi.
Is this possible?
Or Can I use java code? or Can I make my own function?

Just for reference. As soon as you’re not on the same device, it’s no longer “local” in game development terms.

Once you’re dealing with multiple devices, you’re dealing with network code in some form. You’d probably need to build some sort of netcode using Javascript events. There are not currently any examples that I know of.

There are some extensions being worked on by contributors that may be able to help with that, but there are no ETAs on when they’ll be released.

1 Like

So the only way for now is using javasript events?

This might be of interest:

It has been two years since this question has been asked. Are there any further revolutionary concepts that made this idea possible already?

The answers remain the same as before.

The most likely answer is that you would need to deploy netcode/online connectivity. There are multiple methods of doing netcode in the engine today, but you would still have to build out your own logic.

Outside of that you’d need to develop your own solution using Javascript, if you’re wanting something else (that’s not saying there’s something else readily available using JS, but you’d have to build out whatever it would be if it was possible.)