Hey guys,
I’m working on a client/server architecture. I have separated my client and server projects. I am trying to create a world object system.
On the client, I’ve registered a prefab (sword) and on the server, I have spawned it.
When a client is connected to the server, NetworkServer.Spawn is called (On the server through an OnConnectedCallBack). The object gets spawned on the server without problems.
The client will then throw the following error:
"
Failed to spawn server object, did you forget to add it to the NetworkManager? assetId=102b21b41c6ae7e459cfd9fecc53c510 netId=6
UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()
"
Is this the proper way to approach a world object system?
Should the world objects be created on the server, or should they be shipped with the game? What about cheating?
Any concepts of how to design a world object system would be much appreciated.
If anyone is able to help, that’d be great!
These links are snippits of the code:
SERVER:
http://puu.sh/wWNGD/4c8e0a3d75.png
CLIENT:
http://puu.sh/wWNIb/92ccc4755a.png
EDIT:
My goal is to create a world item system where the server keeps track of specific game world items. When a player picks up one of these items, I can authenticate it via the server, and then the server will remove that item from the world and I can add it to the players inventory.
If someone can explain this process that would be great. I thought that’s what I was doing here, but maybe not.