Welcome,
Guest
. Please
login
or
register
.
January 23, 2025, 03:41:24 PM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
TNet 3 Support
»
loading scene issue
« previous
next »
Print
Pages: [
1
]
Author
Topic: loading scene issue (Read 2958 times)
derkoi
Jr. Member
Thank You
-Given: 0
-Receive: 0
Posts: 57
loading scene issue
«
on:
February 10, 2015, 05:01:25 AM »
Hi,
I'm using TNET and noticed my game scene takes a while to load and during this time the player gets disconnected from the server. I set up a loading scene that shows a progress bar as it loads the game scene and I create the channel like this:
TNManager
.
CreateChannel
(
"load_level"
,
false
,
25
,
""
)
;
It works fine and my player no longer gets disconnected however any game objects that have been instantiated before the player enters the scene are not there. It was working before I added the loading scene so I can only assume that's the issue.
Is there anything I can do to fix this?
Thanks
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: loading scene issue
«
Reply #1 on:
February 10, 2015, 05:28:09 AM »
Simply use TNManager.SetTimeout with a high value before doing the level loading.
Logged
derkoi
Jr. Member
Thank You
-Given: 0
-Receive: 0
Posts: 57
Re: loading scene issue
«
Reply #2 on:
February 10, 2015, 05:54:48 AM »
Thanks, that should work.
Out of curiosity, If I wanted to keep my loading level scene so the players don't get confused and this the game has froze, is there a way to get the instantiated gameobjects in the new scene?
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: loading scene issue
«
Reply #3 on:
February 11, 2015, 09:54:58 PM »
"and this the game has froze" -- this makes no sense.
If you want objects to travel from one scene to the next, mark them as DontDestroyOnLoad.
Logged
derkoi
Jr. Member
Thank You
-Given: 0
-Receive: 0
Posts: 57
Re: loading scene issue
«
Reply #4 on:
February 12, 2015, 01:13:00 AM »
Sorry, it was supposed to say 'and think the game has froze'.
I think you're misunderstanding my question. The objects are instantiated in the 2nd scene which is the game scene. When a new player joins someone's game that objects have already been instantiated they're not there. Adding dontDestroyOnLoad wouldn't work because no other scene is loaded after the objects are instantiated. It seems tnet only syncs the first scenes objects which in my case is just a loading scene and doesn't instantiate any objects.
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: loading scene issue
«
Reply #5 on:
February 13, 2015, 09:11:47 AM »
When you switch scenes with TNet via JoinChannel/CreateChannel, the previous channel's objects disappear as far as TNet is concerned. If you have trouble with long loading times and getting disconnected, set your timeout timer to something higher: TNManager.SetTimeout.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
TNet 3 Support
»
loading scene issue