- Home /
Simply trigger a method over network
Hi all,
for my project I need to be able to connect an android device over the network to a standalone to simply call a method, I've tried so many tutorials, other answers, reddit posts but nothing seems to work. Especially with UNET being deprecated it seems to get even harder since pretty much all tutorials from mid 2018 and earlier are obsolete now. So I did found a replacement HLAPI called Mirror on the asset store which seems to be fine but I honestly just have no clue where to start. If anyone could give me a push in the right direction that'd be awesome.
What I need: I have 2 different projects, one for the pc, which runs the main game. The other one is a different android project running on my phone. The question is; how do I make it so I can connect the phone to the PC and use it to remotely trigger methods? I don't need any rendering of the actual game on my phone nor is it considered a seperate player (So I can't use the default NetworkManager which usually does everything for you) It should just display a simple UI with a few buttons to execute methods in the standalone game.
To be clear: The 2 instances that should connect are on different platforms from different projects (since 1 project can't simultaneously be on 2 platforms without switching which takes ages to re-import so this doesn't seem practical)
Thx, Beau
Is this going to work on local network only or do you want it to connect over the internet?
Normally this sort of communication is done via a SERVER in the middle - something both devices know how to access, and the server will distribute the messages between clients.
But if your IP addresses are both going to be static, you can do-it-yourself directly in .NET.
One device opens a server socket, one device opens a client socket, and they communicate on the stream. You'll need to feed the Windows build the IP of the Android device and the Android device needs the IP of the Windows one. I'd suggest placing the server socket on the Windows build - just be aware of your firewall.
Your answer
![](https://koobas.hobune.stream/wayback/20220612203918im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Network troubles using router 0 Answers
UNET - Broadcast Data from Android changes when PC joins Network 1 Answer
Unity networking tutorial? 6 Answers
No response from AWS in android build? 0 Answers
unity unet multiplayer with oculus rift vr - having the oculus only control the local player 1 Answer