Skip to content

Commit 45ea419

Browse files
adds a body to the camera if none exists.
1 parent 5973575 commit 45ea419

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Assets/MixedRealityToolkit-SDK/Features/Input/MixedRealityInputManager.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
using Microsoft.MixedReality.Toolkit.Internal.Utilities;
1515
using System;
1616
using System.Collections.Generic;
17-
using System.Threading.Tasks;
1817
using UnityEngine;
1918
using UnityEngine.EventSystems;
2019

@@ -92,6 +91,12 @@ public override void Initialize()
9291

9392
private void InitializeInternal()
9493
{
94+
if (CameraCache.Main.transform.parent == null)
95+
{
96+
var cameraParent = new GameObject("Body");
97+
CameraCache.Main.transform.SetParent(cameraParent.transform);
98+
}
99+
95100
focusProvider = CameraCache.Main.gameObject.EnsureComponent<FocusProvider>();
96101
gazeProvider = CameraCache.Main.gameObject.EnsureComponent<GazeProvider>();
97102

0 commit comments

Comments
 (0)