[11694] Networking bug: Serialization fails unexpected when object is disabled
tracked
Faxmashine
Requesting serialization on an object and immediately disabling it prevents the serialization request.
Setup:
- Manually synched object with several synched variables
- Remote player is owner
- Remove player leaves instance
- Master takes ownership
- Master resets various variables and requests serialization
- Master disables GameObject
Expected:
Serialization succeeds (This is what happened before the OSC update)Actual:
OnPreSerialization
and OnPostSerialization
are not
called, the variables are not reset. -------------
Since the OSC update, there seems to be a new issue when requesting serialization.
I have only seen this bug occur in CyanLaser's object pool prefab. It is caused by disabling an object shortly after requesting serialization.
If I don't disable the
GameObject
, serilization succeeds (but the script loses functionality)Log In
SnowOrShine
I can also confirm this
Owned objects that are disabled on the calling player's instance do not sync to other players when RequestSerialization() is called
Example:
- Host has an object with a managing script attached
- Another player presses a button which send a [NetworkCallable] event to said object
- The host recieves this message, makes logic changes to synced variables, and calls RequestSerialization() to sync this to all players
- However, because the object is disabled on the host's machine, nothing happens
Phasedragon
tracked
Faxmashine
Faxmashine
I've been able to circumvent the issue by implement a queue system that disables objects after a one second delay.
This, uh, makes me more confident that the behaviour described is a bug, and not an intentional change.
Faxmashine
After further testing, this also seems to happen when enabling GameObjects. After enabling a previously disabled GameObject we
may
also need to wait. Otherwise RequestSerialization fails.Faxmashine
I can reproduce the issue in Super VR Ball 95% of the time (not sure what's up with the other 5% though!)
- Object pool has 2 objects.
- 2 players, master and clientm, start a game and join the race
- Remote client reconnects.
- Remote client is immediately in the race, on a ball, when the ball should have been reset.
This currently happens in all public instances of Super VR Ball as well. The object pool is larger, so it's random whether a player gets assigned a
GameObject
that wasn't reset properly.Faxmashine
Because this was not mentioned in the patch notes I submitted this as a bug. Either way, I'd appreciate if this was looked into, as I heavily rely on the behaviour that was present before the OSC patch.
Oh, and apologies for the typo in the title. I'd edit it if I could! 😁