Skip to content

Commit

Permalink
Fix cursors spawning at the root on initial source detection (#10623)
Browse files Browse the repository at this point in the history
pass MixedRealityPlayspace.Transform to Instantiate instead of moving on the next line
  • Loading branch information
keveleigh authored May 31, 2022
1 parent 7115015 commit fcdf493
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Assets/MRTK/Core/Providers/BaseInputDeviceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,8 @@ private IMixedRealityPointer CreatePointer(ref PointerOption option)
{
using (CreatePointerPerfMarker.Auto())
{
var pointerObject = Object.Instantiate(option.PointerPrefab);
MixedRealityPlayspace.AddChild(pointerObject.transform);
var pointer = pointerObject.GetComponent<IMixedRealityPointer>();
GameObject pointerObject = Object.Instantiate(option.PointerPrefab, MixedRealityPlayspace.Transform);
IMixedRealityPointer pointer = pointerObject.GetComponent<IMixedRealityPointer>();
if (pointer == null)
{
Debug.LogError($"Ensure that the prefab '{option.PointerPrefab.name}' listed under Input -> Pointers -> Pointer Options has an {typeof(IMixedRealityPointer).Name} component.\nThis prefab can't be used as a pointer as configured and won't be instantiated.");
Expand Down

0 comments on commit fcdf493

Please sign in to comment.