Hi everyone,
I'm new to network programming, so that is why I downloaded TNet. I followed both tutorials and got it all up and running.
I have the same setup as in the second tutorial. So I open the start scene, and the auto join script will connect to my game scene. However, I noticed something odd when connecting to the game scene. My script that controls the player instance in the update, can't find the player in the first frame. I debugged the code and it seems that the awake function is called after the update function. Which goes against all Unity logic. It does not happen when I directly launch the game scene, so it has something to do with how TNet connects the player to the server and how it loads in the map.
As a temporary fix I have this at the top of my update function:
if(TutorialPlayer.controlledPlayer == null) return;
But if I have to do that all over my game code everywhere it's gonna end up being a huge mess. I'm just wondering why
this would even happen, and how I can solve this issue.