Skip to content

Commit

Permalink
fix: properly detect NT rotation (#1516)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpach committed Feb 23, 2020
1 parent caab56d commit f0a993c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Assets/Mirror/Components/NetworkTransformBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public abstract class NetworkTransformBase : NetworkBehaviour
[Header("Sensitivity")]
[Tooltip("Changes to the transform must exceed these values to be transmitted on the network.")]
public float localPositionSensitivity = .01f;
[Tooltip("Changes to the transform must exceed these values to be transmitted on the network.")]
[Tooltip("If rotation exceeds this angle, it will be transmitted on the network")]
public float localRotationSensitivity = .01f;
[Tooltip("Changes to the transform must exceed these values to be transmitted on the network.")]
public float localScaleSensitivity = .01f;
Expand Down Expand Up @@ -344,8 +344,8 @@ bool HasEitherMovedRotatedScaled()
// moved or rotated or scaled?
// local position/rotation/scale for VR support
bool moved = Vector3.Distance(lastPosition, targetComponent.transform.localPosition) > localPositionSensitivity;
bool rotated = Vector3.Distance(lastRotation.eulerAngles, targetComponent.transform.localRotation.eulerAngles) > localRotationSensitivity;
bool scaled = Vector3.Distance(lastScale, targetComponent.transform.localScale) > localScaleSensitivity;
bool rotated = Quaternion.Angle(lastRotation, targetComponent.transform.localRotation) > localRotationSensitivity;

// save last for next frame to compare
// (only if change was detected. otherwise slow moving objects might
Expand Down

0 comments on commit f0a993c

Please sign in to comment.