- Home /
Sending events between two different PCs in the same local network
Hello everyone!
I need some advice related to communicating between two different PCs with Unity 2020/2021. The end goal would be that program X on PC 1 is able to communicate with program Y on PC 2, giving simple pings like "trigger this function" or "this value changed". To clarify, program X and program Y are similar, but have different purpose. And PC 1 and PC 2 are connected to the same router via ethernet cable.
I have seen other posts describing using localhost IP or 192.168.0.xxx etc., but I cannot figure out the last details to make it work. As of now, I am experimenting RPCs and NetworkVariables, using the Unity Multiplayer Network Docs as reference (see: https://docs-multiplayer.unity3d.com/). I am able to make a build, launch like 4 versions of the build on PC 1 and communicate between the 4 programs. At that point I am using localhost IP 127.0.0.1 . But whenever I try other IPs I get completely lost, because I do not fully understand where to use which IP... Like, what IP for Server, what IP for Clients.
The attached image shows my current Network Manager and U Net Transport settings, in case it helps.
I would also appreciate if anyone has another good solution for this. I literally just need two different programs and two different PCs to tell each other what to do. Or maybe even have a third program, acting as "controller" for both.
Thank you very much in advance and best regards!