'Spawn scene object not found 1' Error

I’ve been following Brackeys MultiplayerFPS tutorial and I’ve run into an error during Episode 12. For those of you who haven’t seen the tutorial, he implements spawning weapon prefabs when the player connects to the server.

I’m able to test the game fine in the editor, the player can host a server and the weapon spawns in correctly with no errors. But when I build the game and try to connect to the host (built game = client, editor = host), I get errors in the built .exe window saying:

Spawn scene object not found for 1
    > UnityEngine.Networking.NetworkIdentity.UNetStaticUpdate()
Spawn scene object not found for 1

If I host the game in the built .exe and connect to it from the editor I get errors saying:

NullReferenceException: Object reference not set to an instance of an object

My code is the exact same as in the tutorial, the only difference is the Unity version; I’m running v5.4.2f2.

I’ve done some Googling to see if others have had the same error, some people say to give the prefab a network identity and add it to the list of spawnable prefabs in the NetworkManager but it still behaves the same.

Any ideas?

Hi there, hopefully this will work for you as it did for me, try removing the network identity of your prefab and then re-adding it again. I did this and the build works for hosting and joining as a client again.

Im still new to this so I dont really understand why this works but here is the link where I found out about it, so you can read that in more detail if it helps.

https://forum.unity3d.com/threads/spawn-scene-object-not-found-for-1.333122/
@Emmsii

Just discovered that having any disabled Networked Scene Objects can cause this.

I had the same problem, caused by having a networked object as a child of my network manager. Unchild the network object and it worked fine after that.