From 7c1d88a7614693455072578a8eb4137b1d1422fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sinan=20Ermis=CC=A7?= Date: Mon, 10 Aug 2026 03:23:45 +0300 Subject: [PATCH] fix private non-virtual methods not getting called when not properly overriden --- .../Components/NetworkRigidbody/NetworkRigidbodyReliable.cs | 4 +++- .../NetworkRigidbody/NetworkRigidbodyReliable2D.cs | 4 +++- .../NetworkRigidbody/NetworkRigidbodyUnreliable.cs | 4 +++- .../NetworkRigidbody/NetworkRigidbodyUnreliable2D.cs | 4 +++- .../NetworkRigidbodyUnreliableCompressed.cs | 4 +++- .../Components/NetworkTransform/NetworkTransformHybrid.cs | 6 +++--- .../Components/NetworkTransform/NetworkTransformReliable.cs | 6 +++--- .../NetworkTransform/NetworkTransformUnreliable.cs | 6 +++--- 8 files changed, 24 insertions(+), 14 deletions(-) diff --git a/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyReliable.cs b/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyReliable.cs index a88341ae367..258610743b5 100644 --- a/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyReliable.cs +++ b/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyReliable.cs @@ -53,7 +53,7 @@ protected override void Awake() // would give more jittery movement. // FixedUpdate for physics - void FixedUpdate() + protected override void FixedUpdate() { // who ever has authority moves the Rigidbody with physics. // everyone else simply sets it to kinematic. @@ -95,6 +95,8 @@ void FixedUpdate() // the authority owner might use it either way. if (!owned) rb.isKinematic = true; } + + base.FixedUpdate(); } protected override void OnTeleport(Vector3 destination) diff --git a/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyReliable2D.cs b/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyReliable2D.cs index 9872ccc919a..664d71bf13a 100644 --- a/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyReliable2D.cs +++ b/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyReliable2D.cs @@ -61,7 +61,7 @@ protected override void Awake() // would give more jittery movement. // FixedUpdate for physics - void FixedUpdate() + protected override void FixedUpdate() { // who ever has authority moves the Rigidbody with physics. // everyone else simply sets it to kinematic. @@ -114,6 +114,8 @@ void FixedUpdate() #else if (!owned) rb.isKinematic = true; #endif + + base.FixedUpdate(); } } diff --git a/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyUnreliable.cs b/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyUnreliable.cs index e2a34c03a46..0a2884cd8e1 100644 --- a/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyUnreliable.cs +++ b/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyUnreliable.cs @@ -53,7 +53,7 @@ protected override void Awake() // would give more jittery movement. // FixedUpdate for physics - void FixedUpdate() + protected override void FixedUpdate() { // who ever has authority moves the Rigidbody with physics. // everyone else simply sets it to kinematic. @@ -95,6 +95,8 @@ void FixedUpdate() // the authority owner might use it either way. if (!owned) rb.isKinematic = true; } + + base.FixedUpdate(); } protected override void OnTeleport(Vector3 destination) diff --git a/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyUnreliable2D.cs b/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyUnreliable2D.cs index 6c021f00bfd..c48637f699c 100644 --- a/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyUnreliable2D.cs +++ b/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyUnreliable2D.cs @@ -62,7 +62,7 @@ protected override void Awake() // would give more jittery movement. // FixedUpdate for physics - void FixedUpdate() + protected override void FixedUpdate() { // who ever has authority moves the Rigidbody with physics. // everyone else simply sets it to kinematic. @@ -116,6 +116,8 @@ void FixedUpdate() if (!owned) rb.isKinematic = true; #endif } + + base.FixedUpdate(); } protected override void OnTeleport(Vector3 destination) diff --git a/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyUnreliableCompressed.cs b/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyUnreliableCompressed.cs index d8a60950606..e271e37644e 100644 --- a/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyUnreliableCompressed.cs +++ b/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyUnreliableCompressed.cs @@ -53,7 +53,7 @@ protected override void Awake() // would give more jittery movement. // FixedUpdate for physics - void FixedUpdate() + protected override void FixedUpdate() { // who ever has authority moves the Rigidbody with physics. // everyone else simply sets it to kinematic. @@ -95,6 +95,8 @@ void FixedUpdate() // the authority owner might use it either way. if (!owned) rb.isKinematic = true; } + + base.FixedUpdate(); } protected override void OnTeleport(Vector3 destination) diff --git a/Assets/Mirror/Components/NetworkTransform/NetworkTransformHybrid.cs b/Assets/Mirror/Components/NetworkTransform/NetworkTransformHybrid.cs index e2b0c35c2d1..98b440a1539 100644 --- a/Assets/Mirror/Components/NetworkTransform/NetworkTransformHybrid.cs +++ b/Assets/Mirror/Components/NetworkTransform/NetworkTransformHybrid.cs @@ -70,13 +70,13 @@ protected override void Configure() } // update ////////////////////////////////////////////////////////////// - void Update() + protected virtual void Update() { if (updateMethod == UpdateMethod.Update) DoUpdate(); } - void FixedUpdate() + protected virtual void FixedUpdate() { if (updateMethod == UpdateMethod.FixedUpdate) DoUpdate(); @@ -89,7 +89,7 @@ void FixedUpdate() } } - void LateUpdate() + protected virtual void LateUpdate() { if (updateMethod == UpdateMethod.LateUpdate) DoUpdate(); diff --git a/Assets/Mirror/Components/NetworkTransform/NetworkTransformReliable.cs b/Assets/Mirror/Components/NetworkTransform/NetworkTransformReliable.cs index 688f8e5ee62..bde404d08c6 100644 --- a/Assets/Mirror/Components/NetworkTransform/NetworkTransformReliable.cs +++ b/Assets/Mirror/Components/NetworkTransform/NetworkTransformReliable.cs @@ -57,13 +57,13 @@ protected override void Configure() } // update ////////////////////////////////////////////////////////////// - void Update() + protected virtual void Update() { if (updateMethod == UpdateMethod.Update) DoUpdate(); } - void FixedUpdate() + protected virtual void FixedUpdate() { if (updateMethod == UpdateMethod.FixedUpdate) DoUpdate(); @@ -76,7 +76,7 @@ void FixedUpdate() } } - void LateUpdate() + protected virtual void LateUpdate() { if (updateMethod == UpdateMethod.LateUpdate) DoUpdate(); diff --git a/Assets/Mirror/Components/NetworkTransform/NetworkTransformUnreliable.cs b/Assets/Mirror/Components/NetworkTransform/NetworkTransformUnreliable.cs index 53bd3bff330..f5a8102c112 100644 --- a/Assets/Mirror/Components/NetworkTransform/NetworkTransformUnreliable.cs +++ b/Assets/Mirror/Components/NetworkTransform/NetworkTransformUnreliable.cs @@ -38,13 +38,13 @@ protected override void Configure() // update ////////////////////////////////////////////////////////////// // Update applies interpolation - void Update() + protected virtual void Update() { if (updateMethod == UpdateMethod.Update) DoUpdate(); } - void FixedUpdate() + protected virtual void FixedUpdate() { if (updateMethod == UpdateMethod.FixedUpdate) DoUpdate(); @@ -62,7 +62,7 @@ void FixedUpdate() // use LateUpdate to ensure changes are detected in the same frame. // otherwise this may run before user update, delaying detection until next frame. // this could cause visible jitter. - void LateUpdate() + protected virtual void LateUpdate() { if (updateMethod == UpdateMethod.LateUpdate) DoUpdate();