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);
}
}
}