From ec3decd7383b722c6b356cc35b7c162f67d35395 Mon Sep 17 00:00:00 2001 From: JonnyOThan Date: Thu, 29 Sep 2022 14:51:51 -0400 Subject: [PATCH] reset transform when attaching the interaction system, just in case --- KerbalVR_Mod/KerbalVR/Flight.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/KerbalVR_Mod/KerbalVR/Flight.cs b/KerbalVR_Mod/KerbalVR/Flight.cs index 62982347..1bbbe099 100644 --- a/KerbalVR_Mod/KerbalVR/Flight.cs +++ b/KerbalVR_Mod/KerbalVR/Flight.cs @@ -206,6 +206,8 @@ private void OnCameraChange(CameraManager.CameraMode mode) private void FixFlightCamera() { KerbalVR.InteractionSystem.Instance.transform.SetParent(FlightCamera.fetch.transform, false); + KerbalVR.InteractionSystem.Instance.transform.localPosition = Vector3.zero; + KerbalVR.InteractionSystem.Instance.transform.localRotation = Quaternion.identity; } private void FixInternalCamera() @@ -220,6 +222,8 @@ private void FixInternalCamera() KerbalVR.InteractionSystem.Instance.transform.localScale = Vector3.one; KerbalVR.InteractionSystem.Instance.transform.SetParent(InternalCamera.Instance.transform.parent, false); + KerbalVR.InteractionSystem.Instance.transform.localPosition = Vector3.zero; + KerbalVR.InteractionSystem.Instance.transform.localRotation = Quaternion.identity; } static readonly string[] ArmBones = { "bn_l_arm01", "bn_r_arm01" };