UNet NetworkServer.Spawn() not working / Failed to spawn server object, assetId=

Well, after some long hours I’m back here again with this creepy error.

As the title states - my “Network” is not working well. I have done everything obvious and I’m still getting this dirty error:

Failed to spawn server object, assetId=48410ff8cf25a3646ba9e31b8553afcb netId=5

I honestly recheck everything nearly 150 times and it is all good. NetworkManager has the Player prefab set, the “non-working” prefab is set in the NetworkManager Spawn Info unfold “Registered Spawnable Prefabs” This last one is also correctly set in the PrefabSpawner. Everything is just as it is indicated in here

All objects have correctly set up the NetworkIdentity - the PrefabSpawner has it set to “Server Only”.
All objects have NetworkTransform set also.

Everything is just set up fine but, still on the client node I receive this error once and over again.

It only happens on the client node, not on the host.

I’v already read like 4 dozens of topics, questions and answers, most of them having absolutely the same problem, some of them have solution - but unfortunately nothing worked for me : (

Also followed the Unity tutorials step by step. No way!!

Please help.

Spawner script:

using UnityEngine;
using UnityEngine.Networking;

public class PlatformSpawner : NetworkBehaviour
{

    public GameObject platformPref;
    public int numberOfPlatforms;

    public override void OnStartServer()
    {
        for (int i = 0; i < numberOfPlatforms; i++)
        {
            var spawnPosition = new Vector3(
                0.0f,
                i * 2,
                0.0f);

            var spawnRotation = Quaternion.Euler(
                0.0f,
                0.0f,
                0.0f);

            var platform = (GameObject)Instantiate(platformPref, spawnPosition, spawnRotation);
            NetworkServer.Spawn(platform);
        }
    }
}

As I already saw in all cases, including this one, the problem can be due to many different causes.

In this case:::

I ended up switching the network manager Log Level to “Developer” and ran through all the logs there one by one. There I spotted a log, not an “error” nor a “warning” - just a simple log:

Multiple NetworkManagers detected in the scene. Only one NetworkManager can exist at a time. The duplicate NetworkManager will not be used.
UnityEngine.Networking.NetworkManager:Awake()

Well, that was something!
I had to pull my hairs off to find this “multiple” NetworkManager in my project. And just because it is NOT called a “NetworkManager” but a “LobbyManager” - however, this was the “nasty” problem causer.

I looked it all over, and of course, there it was, another “Registered Spawnable Prefabs” field, which logically was completely “empty”.

Finally, just dragging up my prefab into the field was the solution to my headache.

So, if you are using the Unity Network Lobby and your project is using a separate UNet NetworkManager, AND you are having this same issue, make sure you register your prefabs on bothNetworkManagers”.

I hope this helps others : )
Good luck and happy developing!

Unity 5.4.2f2

For me, the problem was happening because the prefabs were being registered after the client attempted to load them. I was registering them, but just not early enough…

So I moved my ClientScene.RegisterPrefab(x) statements to an Awake() trigger and they spawned again perfectly :slight_smile:

Like Datapax above suggested, changing the log level to Developer helped! You’ll be able to see the exact order of events with the Network Manager.