I am using the unity NetworkDiscovery component, and I am wondering how I can auto-start broadcasting when the server starts, instead of the client having to click on the gui: Initialize Broadcast => Start Broadcasting. I would like to be able to put some C# in my start host function so that the user does not have to do anything.
\$\begingroup\$
\$\endgroup\$
Add a comment
|
1 Answer
\$\begingroup\$
\$\endgroup\$
2
Couple of ideas, if possible subscribe to a "Start server event", if thats not available, you could try a Timer , onElapsedTime event and try connectiong every few seconds, until it works, and when it does turn the timer off.
-
\$\begingroup\$ Sorry for my late reply. I am a bit new to unity and I am wondering how exactly I would go about doing this? Could you give me some example code? Thank you! \$\endgroup\$zoecarver– zoecarver2017-07-17 17:33:45 +00:00Commented Jul 17, 2017 at 17:33
-
\$\begingroup\$ @pudility do you have any code efforts that you can share? \$\endgroup\$Fabio S.– Fabio S.2017-07-18 06:21:59 +00:00Commented Jul 18, 2017 at 6:21