Skip to content

Commit

Permalink
reset transform when attaching the interaction system, just in case
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyOThan committed Sep 29, 2022
1 parent 40be3c3 commit ec3decd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions KerbalVR_Mod/KerbalVR/Flight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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" };
Expand Down

0 comments on commit ec3decd

Please sign in to comment.