Hi everybody,
I’m working on a project, where I need to send a GOs position from one to another android device (for ex. via bluetooth or wifi). Can somebody help me (I don’t want to use multiplayer-services because I only want one objects position)?
Thanks to everybody!
Are those devices already connected or not? If not you need to connect them in some way before sending some data. Handling that connection is what all those multiplayer services do, it takes as much work to send one message as it does for sending a thousand.
There are a bunch of Bluetooth plugins, both free and paid, just choose one and follow the instructions.
Through Wifi, if both are on the same local network and you know the local IP you might be able to use WebSockets
Alternatively you can just use a regular web server as an intermediate, do a simple HTTP call to save a position and another one to get it, super simple and doesn’t require any plugins, I covered WebRequests in this tutorial video Download Data Images from inside Unity - Code Monkey
Regardless of whether you want one object’s position or only a file, if you want to send any information from one device to another, you are talking about multiplayer use. You will have to use something to handle that communication. If you want a direct connection between those two devices, you can use Peer-to-Peer (P2P) which doesn’t need an intermediary to handle the game object you want to share between two users. It’s pretty simple to do, especially if both players are on the same network.