Error When Connecting to Server via Client - Failed to Create Object Locally [Netcode]

Hello Unity Community,

I have encountered an error similar to the one discussed in the thread titled “Something breaks when spawning as client” ( URL ). Although the original post in that thread was marked as resolved, I am opening a new thread as I am experiencing the same issue.

The error message I am encountering is as follows:

“[Netcode] Failed to create object locally. [globalObjectIdHash=1129865333]. NetworkPrefab could not be found. Is the prefab registered with NetworkManager?”

I’ve been trying to establish a connection between the client and server using Unity’s Netcode system, but it seems I’m encountering some issues with object creation and prefabs. This error occures when the NetworkManager of the client tries to call StartClient()

It appears that the problem lies in the registration of the prefab with the NetworkManager. From what I understand, the NetworkManager should be aware of the prefabs used within the networking system. However, in my case, it seems that the prefab with the specified global object ID hash (1129865333) is not properly registered.

In the past, we managed to resolve this error by generating new GlobalObjectIDHashes, modifying values within the prefab. However, despite attempting this solution again, the error persists.

I have thoroughly reviewed my code and confirmed that the prefab I am trying to instantiate on the client side is correctly registered with the NetworkManager’s spawnable prefabs list.

If anyone has encountered a similar problem or has any insights or alternative solutions to share, I would greatly appreciate your input.

Here are some relevant details:

  • Unity version: 2021.3.16f
  • Netcode version: 1.5.1
  • Multiplayer Tools: 2.0.0-pre.3
  • although i just upgraded due to the error from verion 1.0 Netcode and 1.0 Multiplayer Tools

I kindly request your assistance in resolving this error. Please feel free to provide any suggestions or thoughts you may have.

Thank you for your attention and support.

Best regards,

1 Like

Does the hash of the prefab registered on the network manager on the client the same as the hash of the prefab spawned on the server?

Solved.
Thanks for the reply, it helped me figure out, that I accidentally created 2 Object Prefabs and I referenced them both in different locations. So classic layer 8 error. :FacePlam:

One thing that I figured out though is that the referenced NetworkObjects are not allowed to be in the scene already,

Nevertheless, thanks to you and have a good week.

1 Like

In my game they are in the scene already but it works for me only in older versions of netcode.