diff --git a/Assets/Mirror/Runtime/SyncObject.cs b/Assets/Mirror/Runtime/SyncObject.cs index 9edab8570..dc7c5ca70 100644 --- a/Assets/Mirror/Runtime/SyncObject.cs +++ b/Assets/Mirror/Runtime/SyncObject.cs @@ -20,7 +20,7 @@ public abstract class SyncObject // => Weaver calls InitSyncObject and replaces it // => if it was not replaced, then it was a runtime change which is not allowed. // ===> this way we can show SyncVar in the Inspector! - public virtual Action OnDirty { get; set; } = () => + public Action OnDirty = () => throw new Exception("SyncObject was not initialized. Do not create 'new SyncObject's at runtime. Define them once, then Weaver will initialize them."); /// Used internally to check if we are currently tracking changes.