Search Unity

Failed to spawn server object...

Discussion in 'Multiplayer' started by GameDevJon, Jul 30, 2017.

  1. GameDevJon

    GameDevJon

    Joined:
    Jul 21, 2017
    Posts:
    25
    Hey guys,

    I'm working on a client/server architecture. I have separated my client and server projects. I am trying to create a world object system.

    On the client, I've registered a prefab (sword) and on the server, I have spawned it.

    When a client is connected to the server, NetworkServer.Spawn is called (On the server through an OnConnectedCallBack). The object gets spawned on the server without problems.

    The client will then throw the following error:

    "
    Failed to spawn server object, did you forget to add it to the NetworkManager? assetId=102b21b41c6ae7e459cfd9fecc53c510 netId=6
    UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()

    "

    Is this the proper way to approach a world object system?

    Should the world objects be created on the server, or should they be shipped with the game? What about cheating?

    Any concepts of how to design a world object system would be much appreciated.

    If anyone is able to help, that'd be great!

    These links are snippits of the code:

    SERVER:
    http://puu.sh/wWNGD/4c8e0a3d75.png

    CLIENT:
    http://puu.sh/wWNIb/92ccc4755a.png


    EDIT:

    My goal is to create a world item system where the server keeps track of specific game world items. When a player picks up one of these items, I can authenticate it via the server, and then the server will remove that item from the world and I can add it to the players inventory.

    If someone can explain this process that would be great. I thought that's what I was doing here, but maybe not.
     
    Last edited: Jul 30, 2017
  2. GameDevJon

    GameDevJon

    Joined:
    Jul 21, 2017
    Posts:
    25
    RESOLVED

    The GUID didn't match. Simply making them match fixed the issue.

    Not a 100% solid solution, but for now it's okay.
     
  3. jose-araujo

    jose-araujo

    Joined:
    Nov 17, 2016
    Posts:
    34
    How do you change the GUID in order for them to match?