Facepunch / sbox-issues

177 stars 12 forks source link

Network Snapshot doesn't seem to work with Prefab (only tested with material). #5559

Open DoctorWhoFR opened 6 months ago

DoctorWhoFR commented 6 months ago

Describe the bug

When i make an update of an game object that is linked to a prefab, and when a new player is connecting, he doesn't receive all modification made to the prefab like material.

So when breaking the prefab, and updating the material, this work fine, after a player join a receive every game object state correctly including the material.

To Reproduce

1 - create a new object with a model renderer into 2 - change the material of the model using code (because we can't access currently prefab property) 3 - Join with a new instance 4 - New instance should not see the updated material.

(NOT NETWORKED)

Do the same thing with one additional step :

1 - create a new object with a model renderer into (1 bis) - Break prefab using code or just use a basic game object 2 - change the material of the model using code (because we can't access currently prefab property) 3 - Join with a new instance 4 - New instance should not see the updated material. (WORK FINE)

Expected behavior

I expected that like a normal "game object", prefabs modification should be reflected in the "network snapshot" sent to player's when they join a game.

Without breaking it (expect if i miss-understood something)

Media/Files

https://github.com/Facepunch/sbox-issues/assets/26010905/c272497b-178b-432f-88dc-0e3ac0fda5fb

Additional context

Love s&box ^^

PolSpock commented 6 months ago

This looks similar to my issue 🤓 https://github.com/Facepunch/sbox-issues/issues/5046