Author Topic: Host cant see players, who loads the scene earlier.  (Read 3620 times)

GantZ_Yaka

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 21
    • View Profile
Host cant see players, who loads the scene earlier.
« on: March 04, 2014, 10:59:41 PM »
In the following steps, I find a mistake and can not find ways to fix it.

1)The player opens a channel, but does not load the scene.
2)Other players join his channel and load their scenes.
3)The first player who is the host load his scene.

as a result:
1)All players, except the host, see each other, including the host.
2)Host does not see anyone.
3)If we now join the channel a new player, the new player will see all the players (and the host sees new player too). Host can not only see those players in the channel who have downloaded their scenes before it.

In all downloadable scenes I have a script that is in the void "Start()" spawns  player prefab by "TNManager.Create(playerPrefab, pos, rot)".

Tell me why I get such a result? Is there a way to open a channel by host without downloading scene, download it after many other players do it, and see all the players who went into the game scene earlier than the host?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Host cant see players, who loads the scene earlier.
« Reply #1 on: March 05, 2014, 09:02:20 AM »
Everything should be consistent for all players, host or no host. If one player loads the scene, so should everyone else. You shouldn't exclude certain players as this will easily lead to a discrepancy in states. Why are you trying to withhold scene loading from one of the players?

When you do Application.LoadLevel it destroys all non-persistent game objects, which also destroys all previously instantiated players.

If you want to delay level loading, do it for everyone. Pass 'null' for the level name, and do TNManager.LoadLevel on the host when ready.

GantZ_Yaka

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 21
    • View Profile
Re: Host cant see players, who loads the scene earlier.
« Reply #2 on: March 05, 2014, 10:52:10 PM »
Because that's what I'm working - not really a game, it's a multiplayer simulator training for miners, where they control their characters in a virtual mine with tablet PCs, and the game is projected onto the wall using a 3D projector :D
There are two types of clients here. Client 1 - the character in the game scene, client 2 - remote control character (Tablet PC). When connected to a channel, the player must first choose his tablet from the list of connected clients - tablets. So first host creates a channel, then chooses his remote control.
At this time the first game scene can run another players. and the host does not see the first players in the scene. I need to implement the ability to connect new players during the game.
Now im trying to the player, who loads the first scene, automatically became the host channel ... do not know, will it work well.