Search Unity

Network View Doesn't work right

Discussion in 'Multiplayer' started by The-Game-Master, Oct 28, 2014.

  1. The-Game-Master

    The-Game-Master

    Joined:
    Aug 6, 2014
    Posts:
    54
    I have a multiplayer game (I'm trying to make it multiplayer anyway) and this is my issue. When I start a server and spawn in, everything goes fine. Then someone else joins mid-game and everything that was moved by anyone on the server before the game started isn't in the same place, it's all in the default place. I can shoot my wall with a flare gun and it topples over. However, when someone joins after the game has started and looks at it, they see the object standing upright, where it would be. This doesn't happen very often for people who were in the game prior to it starting. I keep getting errors like "Received state update for view ID SceneID: 8 Level Prefix: 0 but no initial state has ever been sent. Ignoring message." Every object has a network view attatched to it. When someone joines mid-game, they can't see anyone else, but anyone who was on the server before the game "started" can see them.
    If you could help me with this issue, I would be grateful.
     
  2. The-Game-Master

    The-Game-Master

    Joined:
    Aug 6, 2014
    Posts:
    54
    It's an FPS by the way. Also, I've only tried this on my local computer, but I assume the issue is the same reguardless.
     
  3. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,072
    Are you using PUN or Unity's networking?
    The position where objects were Instantiated doesn't update by moving it. Usually, when someone joins, the objects with a PhotonView (or network view) should send an update. You can wait for those before you show the scene or the object (then at the correct position).
    In PUN, I can't find the output of "Received state update", so I guess it's Unity's Networking after all? Then I don't have a lot of experience with it...
     
  4. The-Game-Master

    The-Game-Master

    Joined:
    Aug 6, 2014
    Posts:
    54
    I'm using the built-in Unity Networking. How would I wait to show the scene? It instantly loads the scene upon the game starting.
     
  5. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,072
    I am not sure if the scene gets automatically loaded when you connect to a game host.
    My knowledge about Unity's networking is limited, sorry.
     
  6. The-Game-Master

    The-Game-Master

    Joined:
    Aug 6, 2014
    Posts:
    54
    Is there a way that I could update it when they connect? If you don't know, it's OK.
    Thanks for the help!