Facepunch / sbox-issues

162 stars 11 forks source link

Gameobject fails to deserialize properties that target objects inside bone hierarchies #5582

Open Fortune117 opened 1 month ago

Fortune117 commented 1 month ago

Describe the bug

When trying to network a player prefab I receive an error on the connecting client when they try to deserialize the game object for it:

Error when deserializing PlayerController on (Player - fortune (2)).Eye (GameObject 47e979ba-102f-4a93-8e2d-d239f54b3ff6 was not found)
{
  "_type": "gameobject",
  "go": "47e979ba-102f-4a93-8e2d-d239f54b3ff6"
}

The property on the player prefab looks like this: image

It points to this game object: image

The issue seems to only happen when the Model gameobject is set to the Network Object networking mode, but does correctly deserialize when set to Network Snapshot. In my case, I need it to be Network Object for the purpose of syncing rotation.

To Reproduce

  1. Download the repo
  2. Connect via instance
  3. See the error in console
  4. Change the network mode of the Model gameobject to Network Snapshot and it deserializes correctly.

Expected behavior

Should deserialize correctly.

Media/Files

bug_repo.zip

Additional context

No response

Nolankicks commented 1 month ago

It’s because the body is networked

wumtdev commented 5 days ago

Same problem. Client failed to link properties (components, gameobjects) on networked (object mode) parents related to networked (object mode) children. Deserializing error (GameObject not found): image

Note that all stuff works correctly if child is networked in snapshot mode