3
\$\begingroup\$

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.

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\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\$ Commented Jul 17, 2017 at 17:33
  • \$\begingroup\$ @pudility do you have any code efforts that you can share? \$\endgroup\$ Commented Jul 18, 2017 at 6:21

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.