diff --git a/Assets/MirageXR/Common/Scripts/CombinedEditor/ActionDetailView/Annotation Editors/GhostRecorder.cs b/Assets/MirageXR/Common/Scripts/CombinedEditor/ActionDetailView/Annotation Editors/GhostRecorder.cs index e868374bb..8d9546599 100644 --- a/Assets/MirageXR/Common/Scripts/CombinedEditor/ActionDetailView/Annotation Editors/GhostRecorder.cs +++ b/Assets/MirageXR/Common/Scripts/CombinedEditor/ActionDetailView/Annotation Editors/GhostRecorder.cs @@ -157,7 +157,7 @@ private static Pose CreateLocalPose(Transform anchor, Vector3 position, Quaterni return new Pose { position = anchor.InverseTransformPoint(position), - rotation = Quaternion.Inverse(anchor.parent.localRotation) * rotation, + rotation = Quaternion.Inverse(anchor.localRotation) * rotation, }; } diff --git a/Assets/MirageXR/Common/Scripts/Grid/ManipulationController.cs b/Assets/MirageXR/Common/Scripts/Grid/ManipulationController.cs index 37f14af32..19064a61f 100644 --- a/Assets/MirageXR/Common/Scripts/Grid/ManipulationController.cs +++ b/Assets/MirageXR/Common/Scripts/Grid/ManipulationController.cs @@ -118,9 +118,12 @@ private void OnManipulationUpdated(GameObject source) return; } - UpdateCopyPosition(source); - SnapToGrid(_copy); - UpdateGridLines(_copy); + if (_copy) + { + UpdateCopyPosition(source); + SnapToGrid(_copy); + UpdateGridLines(_copy); + } } private void OnManipulationEnded(GameObject source) @@ -276,8 +279,11 @@ private void HideGridLines() private void UpdateCopyPosition(GameObject source) { - _copy.SetPose(source.GetPose()); - _copy.transform.localScale = source.transform.lossyScale; + if (_copy) + { + _copy.SetPose(source.GetPose()); + _copy.transform.localScale = source.transform.lossyScale; + } } private void HideCopy()