Tasharen Entertainment Forum
Support => TNet 3 Support => Topic started by: gg67 on February 11, 2014, 12:34:59 PM
-
I was messing around with LoadLevelAsync and passing null for the levelname (as you mentioned in another post) so I could handle my own level loading. However, it seemed that the channel was still loading the level name that the persistent channel was using. Do persistent channels treat joining differently than non-persistent channels?
Also, do you know the best way to use LoadLevelAsync (or additive)? From what I can tell, it still causes the fromLevel to freeze up when moving from fromLevel to toLevel. Do you have any experience with this? (I know it's not directly related to TNet).
Thanks
Edit: I noticed it's happening for any kind of channel. Does the server respond with the channel level name and use that to load it?
-
1. Join a channel with a null ID.
2. Once joined (OnNetworkJoinChannel received), TNManager.isActive = false, and Application.LoadLevelAsync (or additive -- better to do it via Additive).
3. Once everything finished loading (in some script's Start or Update function, ideally), TNManager.isActive = true.
Just a note... for this to work, all TNObjects must be already present by the beginning of stage 2, or your RFCs won't work.
-
So if I only pass null and don't do any of that other stuff, the correct level will still load because it's getting that info from the server?
-
If someone at any point used TNManager.LoadLevel with a level name, yes... it will.
The trick is to ensure that you never use it. Use Application.LoadLevel instead to switch levels yourself.