Hello,
I have 2 scenes,
in the first i have the network manager and network manager hud where specified the offline and online scenes, here i don’t specified the spawnable prefabs.
In the second, i have a script where i specified the prefab to spawn. Here first to spawn i registered the prefab:
public override void OnStartClient()
{
base.OnStartClient();
foreach (GameObject obj in asteroidPrefabs)
{
ClientScene.RegisterPrefab(obj);
}
}
then if isServer i instanciate the prefab and then i spawn the prefab.
The problem is on the client:
I received the error on the client like (on the host the spawn is ok):
Failed to spawn server object, did you
forget to add it to the
NetworkManager?
assetId=d8b3239a5790cd944ad93a8f8effa2b0
netId=6
UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()
What is wrong?
i following the manual:
https://docs.unity3d.com/Manual/UNetSpawning.html
ps:
i am trying to use ClientScene.RegisterPrefab and don’t the registered spawnable object of Network Manager.
Here there is the project:
https://drive.google.com/file/d/1e2VpyKc59Zid5lXjuVFL8HqBsJWCNAbF/view?usp=sharing
Thanks,
bye