Failed to spawn server object, did you forget to add it to the NetworkManager?
Hello everyone,
I am trying to spawn a GameObject that was dynamically placed in my scene hierarchy on the server side onto the client side. But I am facing the following challenges:
- Everything goes smoothly with the OnStartServer() method when preparing the dynamically instantiated GameObject locally on the server. I manually added NetworkObject and NetworkIdentity components to it.
- I then register this GO as a registered n/w prefab using NetworkClient.RegisterPrefab method in order to Register spawnable prefab with custom assetId.
- I then create a SyncDictionary to hold the custom assetId and the GO as a pair.
Upon doing all of this, I see that on the server side, I have the GO in the SyncDictionary but not on the client side. And I am getting the Failed to spawn server object, did you forget to add it to the NetworkManager? assetId=4051406874 netId=3 on the client side.
How do I get the dynamic GO to be visible on the client side?
See the images below. I am at a loss. I appreciate all the help from this community of scholars and developers.
Thanks in advance!
I was able to solve it. Here are the key hurdles I navigated:
Advanced Serialization: Developing a custom mesh serializer and deserializer (on the fly) from scratch to ensure that complex 3D data transmits accurately and efficiently over different network conditions was challenging and rewarding.
Network Efficiency: The main goal was to minimize latency and maximize throughput within a host-client topology. This required innovative solutions in data compression and chunking strategies to handle real-time mesh updates without sacrificing performance.