Ah sorry, I didn't realize you were disabling things.
So what you currently have enabled related to TNet:
- a Connection Object with a TNManager script (with a Player prefab) and a Connection Controller script
... and disabled:
- PlayerSpawn Object with TNAutoCreate script (without a prefab)
- TNJoin Object with TNManager (leftover presumably) and a TNAutoJoin script that has Game has the first level
With just the enabled objects, all you have is a TNManager and your connection controller script:
// Use this for initialization
void Start () {
TNManager.Connect( "aursand.no:5127" );
}
void OnNetworkConnect ( bool success, string message ) {
if ( success ) {
TNManager.JoinChannel( 1, "Game" );
}
}
void OnNetworkJoinChannel ( bool success, string message ) {
if ( success ) {
TNManager.Create( "Prefabs/Player", false );
}
}
One problem I see is that the first level you're trying to join is the same scene all of this is within. Your first level that you reference is called "Game" which is the name of the scene.
You should create a connection scene that goes to the Game scene on connection. That scene would have the Connection Object with a TNManager script. Your TNJoin Object should also be present, and assuming all the connection details like address and port are correct you shouldn't have to change anything.
I haven't checked out the latest update which says the TNManager doesn't need to be present all the time, but I would make sure your Connection object with the TNManager carries over to the new scene.
In your game scene, you should have your PlayerSpawn object with a player prefab (same one you put in TNManager).
tl;dr You're trying to go to the same scene you're in when you connect to the server.