Expose read-only SceneId and callback-free SyncVar setter for state serialization #1017
desuqcafe
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
External systems that serialize/restore SyncType state (save/load, host migration, rollback) currently require reflection to access two internal members.
SyncVar<T> — setting value without triggering OnChange
When restoring serialized state, OnChange callbacks shouldn't fire, subscribers would receive stale previous values and potentially corrupt their own state.
Current workaround (reflection):
SetValue(value, calledByUser: false)doesn't work here because it still invokesInvokeOnChange, and theIsServerStartedpath skipsUpdateValuesentirely on clientHost.I saw there is
ResetStatedoes_value = _initialValuedirectly. Something like:Or using
UpdateValues(value)to also update the interpolator and prevent visual snapping.NetworkObject.SceneId (read-only access)
IsSceneObjectis public, but correlating scene objects across sessions requires the actual value. Currently accessed via reflection:A public getter would be sufficient:
Beta Was this translation helpful? Give feedback.
All reactions