Search Unity

OnObjSpawn netId: ### has invalid asset Id

Discussion in 'Multiplayer' started by malkere, Dec 3, 2018.

  1. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I have all of my prefabs stored in public lists on my custom NetworkManager. Prior to hosting/connecting I loop through the lists and RegisterPrefab them all. This has worked fine until 4-5 hours ago, all the sudden nothing works. On the client I get
    Code (CSharp):
    1. CRC Local Dump PlayerInventory : 0
    2. CRC Remote Dump PlayerInventory : 0
    on several items and
    Code (CSharp):
    1. OnObjSpawn netId: ### has invalid asset Id
    on what looks like every object in scene. Oddly the objects in scene all look present, but there are huge gaps between netId's like every 800. 801-1600 are present, in order. 1601-2400 are not present. Though the scene looks well populated.

    I have tried rebuilding the NetManager, and REALLY don't want to, but will try building a new player prefab. I have also tried defining a specific runtime NetworkHash128.Parse(prefab.name) on the server, as a reddit post suggested, but no luck.

    I don't use the NetworkManager's own scene objects list, which is listed as bugged (fixed in 2018.3) I'm running 2018.2.2f1. I was not messing with prefabs or spawning or the NetworkManager. Suddenly nothing works. Is there any way to understand what is causing this, or how to attempt to fix it?

    Thank you~
     
  2. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I had a couple scripts marked as NetworkBehaviours from when I first started implementing multiplayer. Which auto-assigns them a NetworkIdentity in runtime. With them not registered as ClientPrefabs on both the Server and Client, it breaks everything. Though the warnings make no mention of any of that =o=

    putting the editor in host mode and searching for t:NetworkIdentity in the heirarchy shows everything with a netId. I noticed things on there that I wasn't Registering, and putting them back to MonoBehaviours fixed the mismatch.