From a96fe27037cb407a5792f2e167fc9da38daf4a23 Mon Sep 17 00:00:00 2001 From: MrGadget <9826063+MrGadget1024@users.noreply.github.com> Date: Wed, 10 Apr 2024 12:19:12 -0400 Subject: [PATCH] fix(NetworkAnimator): Default animatorSpeed to 1 (#3801) --- Assets/Mirror/Components/NetworkAnimator.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Assets/Mirror/Components/NetworkAnimator.cs b/Assets/Mirror/Components/NetworkAnimator.cs index 21890980d..657c28fa2 100644 --- a/Assets/Mirror/Components/NetworkAnimator.cs +++ b/Assets/Mirror/Components/NetworkAnimator.cs @@ -31,11 +31,12 @@ public class NetworkAnimator : NetworkBehaviour public Animator animator; /// - /// Syncs animator.speed + /// Syncs animator.speed. + /// Default to 1 because Animator.speed defaults to 1. /// [SyncVar(hook = nameof(OnAnimatorSpeedChanged))] - float animatorSpeed; - float previousSpeed; + float animatorSpeed = 1f; + float previousSpeed = 1f; // Note: not an object[] array because otherwise initialization is real annoying int[] lastIntParameters;