"Invalid Hash": spawning Scene-Placed NetworkObjects that are not ON at Start

Hey there,

I’m trying to Synchronize my scenes from server to clients. The SceneManagement system seems to work great, but only when all of the Scene-Placed NetworkObjects you want to use are turned ON when the scene first loads.

In my case, I have many different “areas” in my scene that all get turned on when the players reach them. To me, this should be pretty easy to handle, but it doesn’t seem to work with Netcode. I’ve read that I have to manually Spawn() any scene objects that get turned on later during the course of the playthrough, however, that just spits an Invalid Hash error at me.

As long as the objects are turned on when the scene first loads on the server, then the synchronization behaves correctly and all the clients get valid spawned objects that they can interact with. If the objects are not on at the start, and later get turned on, I get the Invalid Hash error. Has anyone been able to work around this? I really don’t want to have to put 200+ prefab references into my NetworkManager and dynamically spawn all of this stuff.

Thank you in advance :slight_smile:

I am getting the same errors. My prefabs are registered with the network manager prefabs list. After upgrading to 1.3.1 I get this warning: “Runtime Network Prefabs was not empty at initialization time. Network Prefab registrations made before initialization will be replaced by NetworkPrefabsList.”. I don’t know if it’s related.

@lavagoatGG from what I understand in the documentation, you either want to use the NetworkPrefabsList or the Scene-Placed NetworkObjects. I think you can use a combination but that would be something like: Health Drops are in the NetworkPrefabsList, while things such as locked doors that are easier to place in the scene are Scene-Placed NetworkObjects (if any of that makes sense).

I’m trying to lean mostly on the Scene-Placed NetworkObjects as that appears to be the most suited to how Unity developed the Netcode systems in general.

It appears that I can modify the NetworkSpawnManager so that it grabs all NetworkObjects, both active and inactive, and registers them during the Scene Synchronization. It would take a bit of modification but would work. I don’t want to modify the library though, as I want to keep any functionality true to how it’s provided so that I don’t run into issues with plugin updates down the road.