From dea7b587925812952f56db331cf75275a25c8ce1 Mon Sep 17 00:00:00 2001 From: Liu Date: Wed, 13 Mar 2019 19:15:34 +0800 Subject: [PATCH] Fix network animator doesn't sync float value as expected (#589) Maybe we should do float sync when the Abs of newValue - lastValue > 0.001f --- Assets/Mirror/Components/NetworkAnimator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Mirror/Components/NetworkAnimator.cs b/Assets/Mirror/Components/NetworkAnimator.cs index dd3846614..450c12553 100644 --- a/Assets/Mirror/Components/NetworkAnimator.cs +++ b/Assets/Mirror/Components/NetworkAnimator.cs @@ -230,7 +230,7 @@ bool WriteParameters(NetworkWriter writer, bool autoSend) else if (par.type == AnimatorControllerParameterType.Float) { float newFloatValue = m_Animator.GetFloat(par.nameHash); - if (Mathf.Abs(newFloatValue - lastFloatParameters[i]) < 0.001f) + if (Mathf.Abs(newFloatValue - lastFloatParameters[i]) > 0.001f) { writer.Write(newFloatValue); dirtyBits |= 1u << i;