sbox-issues
sbox-issues copied to clipboard
`[Property]` on a `NetworkMode.Never` GameObject is attempted to be read by other players
Describe the bug
Hi,
Adding a [Property]
attribute to a GameObject whose NetworkMode
is set to NetworkMode.Never
will be attempted to be read by other players, triggering an Unknown GameObject c8401b65-398b-4d71-a9e6-511b3d4489f3
warning in the console.
To Reproduce
- Download https://github.com/Facepunch/sbox-scenestaging
- Edit
NetworkTest.cs
by adding the following code:
[Property] public GameObject NeverNetworked { get; set; }
[Property] public Gun ComponentIntoNeverNetworkedGameObject { get; set; }
protected override void OnStart()
{
base.OnStart();
if (IsProxy) return;
NeverNetworked = new GameObject();
NeverNetworked.Name = "NeverNetworked";
NeverNetworked.Parent = GameObject;
NeverNetworked.NetworkMode = NetworkMode.Never;
ComponentIntoNeverNetworkedGameObject = NeverNetworked.Components.Create<Gun>();
}
- Play
networking.scene
and join with another user. Check the console and see the warning - Remove the
Property
attribute frompublic GameObject NeverNetworked { get; set; }
and restart: no error should occur.
Expected behavior
A GameObject set to NetworkMode.Never
should not print an error even if the [Property]
attribute is present
Media/Files
No response
Additional context
No response