unet game spawning player at spawn points not working
Hello everyone I am having an issue with unity's networking system during the loading of the game scene and the spawning of the player. Sometimes it works fine and sometimes it does not. In the game scene i have 3 spawn points all having the network start position component attached to them. When I do testing with 2 clients or more, it seems that 1 player spawns at the correct location (randomly at one of the 3 spawn points as expected) however the other player spawns at a location no where near any of the 3 spawn points. I cant seem to figure out why it behaves this way. The spawning method on my network lobby manager that i am using is random spawn , iv also tried round robin however that's not working as well. At this point I want to override the spawning code to specifically spawn the player using my own logic.
Do note that this is a lobby scene scenario, so initially we add all the players to a lobby and after all players are ready we then use a ServerChangeScene() method to load the game scene. It seems what i need probably executed after this bit of code.
Can anyone help me with what may be the problem, or tell me which function do i need to override to control the spawn point selection myself for my player to spawn in . Also does anyone know where i can go or if its possible to look at the low level code behind the networking functions, its very difficult to use them as black boxes i need to understand the underlying instruction. I want to understand exactly in which order the network manager calls its functions normally (in order to go all the way from establishing a connection to spawning the player in game, what are the API calls in the middle)
Thanks
Your answer
Follow this Question
Related Questions
Networking concept and spawning questions 1 Answer
UNET : random bugs with spawning 0 Answers
How do I rotate a Networked gameobject on spawn? 0 Answers
UNET 5.4 - Spawn an object from client...and move it around from client....? 1 Answer
NetworkServer is not active. Cannot spawn objects without an active server. 0 Answers