- Home /
Netcode for GameObjects - how to broadcast to find the server in the same LAN?
Hi,
So, I'm following this tutorial on the Netcode for GameObjects (https://docs-multiplayer.unity3d.com/netcode/current/tutorials/helloworld/helloworldintro) however I want to connect to another computer on the same LAN. I can do this if I simply put the correct IP of the other computer, however, I like the client to find the server. I know that I need a broadcast to do this, but I'm lost on how to implement it. I'm using the unity 2020.3 on windows 10.
Answer by VanToRiaXVII · May 05 at 03:09 PM
What you're talking about is NetworkDiscovery, from what I found it's not available yet for Unity Netcode. However, there's this repository that would allow you to see how it should be implemented:
https://github.com/Unity-Technologies/multiplayer-community-contributions/tree/main/com.community.netcode.extensions/Runtime/NetworkDiscovery
Thanks, this is exactly what I need, but I still have a question. Should I use the connect address of the broadcast in Unet Transport? And in Network Discovery, should I leave all the fields as they are now?
Yes. The connect address should be the address that has been found with NetworkDiscovery. Make sure the ports are the same.
For your other question. In the example NetworkDiscovery, the application ID looks a bit weird, so you might want to change it. Again, make sure you're connecting on the right port.
Your answer
![](https://koobas.hobune.stream/wayback/20220613060207im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Lan Broadcast 0 Answers
Find multiple hosts with NetworkDiscovery? 0 Answers
Broadcast camera render over network 2 Answers
How to find all http servers on local network at the same time? 2 Answers
[UNet] How to use BroadcastDiscovery? 0 Answers