Connect two computers via Ethernet

I have previously made a multiplayer game that connects players via Unity’s Master Server, but now I would like to connect players through ethernet cables (peer to peer connection). Is this possible with Unity? I want the connections setup so that they can play offline, just connect their computers.

Of course it’s possible.

It basically uses the same setup as before: One or both clients “host” the game. This means their game accepts incoming connections.

The Master Server of Unity is a list of machines that do host and their addresses. You need to replace this.

In the easiest implementation and in the same network, you could make a UI that allows players to enter the IP of a host. If a player hosts, you should show the IP of that machine. Players need to tell each other the IP and should be able to connect.

See: Unity - Scripting API: Network.Connect