- Home /
Question by
ramonfr · Jul 07, 2012 at 05:36 AM ·
networkloadlevelnetwork.instantiate
Network.Instantiate after loading level?
I need to instantiate a player right after the level was loaded (all trought a network).
This is what I'm doing:
When the player creates the server, he "network loads level". After the level was loaded, the spawn script runs the Network.Instantiate function inside the Start() function.
If a player connects to a server, the Network.Instantiate is executed inside the OnPlayerConnected().
Alright, but this method doesn't seems to be very smart and very vulnerable.
How can I instantiate a player after some level was loaded?
Comment
Answer by whydoidoit · Jul 07, 2012 at 10:51 AM
Use OnLevelWasLoaded as the moment to instantiate your player.
Your answer
![](https://koobas.hobune.stream/wayback/20220613073823im_/https://answers.unity.com/themes/thub/images/avi.jpg)