diff --git a/Runtime/MAMoveIndependently.cs b/Runtime/MAMoveIndependently.cs index 1bf2d269..ba5ff444 100644 --- a/Runtime/MAMoveIndependently.cs +++ b/Runtime/MAMoveIndependently.cs @@ -123,7 +123,7 @@ private void CheckChildren(Transform parent) var deltaRot = Quaternion.Angle(localRotation, state.childLocalRot); var deltaScale = (localScale - state.childLocalScale).sqrMagnitude; - if (deltaPos.sqrMagnitude < EPSILON && deltaRot < EPSILON && deltaScale < EPSILON) + if (deltaPos.magnitude < EPSILON && deltaRot < EPSILON && deltaScale < EPSILON) { Matrix4x4 childNewLocal = parent.worldToLocalMatrix * state.childWorld; @@ -190,9 +190,11 @@ void OnUpdate() var deltaRot = Quaternion.Angle(_priorFrameState.rotation, transform.rotation); var deltaScale = (transform.lossyScale - _priorFrameState.lossyScale).sqrMagnitude; - if (deltaPos.sqrMagnitude < EPSILON && deltaRot < EPSILON && deltaScale < EPSILON) return; + if (deltaPos.magnitude < EPSILON && deltaRot < EPSILON && deltaScale < EPSILON) return; CheckChildren(); + + _priorFrameState = transform.localToWorldMatrix; } } } \ No newline at end of file