You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experiencing an issue where host sync'd properties are getting stomped on joining instances after being set in OnActive. Through my experimentation, I have found this affects all values synced from the host, not just components or GameObjects.
Here is the flow (all run from the host):
In GrubsNetworkManager.cs, we use INetworkListener's OnActive to create a Client from a prefab. We clone the prefab, and network spawn it from the joining connection.
Then, we call OnNetworkActive on the newly created client. The player prefab is cloned, network spawned through the same connection, and assigned to host sync'd property Player on the Client.
This successfully sets, but is stomped a few ticks later, ONLY SOMETIMES, to being null.
Attempting to assign other HostSync'd values in OnNetworkActive, even test values like int Test and assigning it 8, will also get stomped in the same way.
Below is a video of this happening. I was more concerned about the networked ConnectionId here, but the same principle applies to all properties being set.
Start a game in the beach.scene, and join with a second instance.
If the player cards both populate properly, reconnect on the second client until the second instance player card is blank, as shown in the video.
Logging various HostSync'd properties in OnUpdate will demonstrate that the properties do get set initially, but quickly get stomped.
I have tried even using the HostSync'd property as a backing field for another property, and logging when the property gets set, but clearly this is being stomped from the engine side, since there is nothing from my game code setting this value.
Expected behavior
The HostSync'd properties do not get stomped a few ticks after being set.
Media/Files
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
I'm experiencing an issue where host sync'd properties are getting stomped on joining instances after being set in OnActive. Through my experimentation, I have found this affects all values synced from the host, not just components or GameObjects.
Here is the flow (all run from the host):
Player
on the Client.int Test
and assigning it 8, will also get stomped in the same way.Below is a video of this happening. I was more concerned about the networked
ConnectionId
here, but the same principle applies to all properties being set.2024-12-27.10-49-43.mp4
To Reproduce
player-system-improvements
branch of Grubs at this commit: https://github.com/apetavern/grubs/tree/797a9c07b261121e4e30461c919727e0c36202e3beach.scene
, and join with a second instance.reconnect
on the second client until the second instance player card is blank, as shown in the video.I have tried even using the HostSync'd property as a backing field for another property, and logging when the property gets set, but clearly this is being stomped from the engine side, since there is nothing from my game code setting this value.
Expected behavior
The HostSync'd properties do not get stomped a few ticks after being set.
Media/Files
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: