Skip to content

Commit fcdf493

Browse files
authored
Fix cursors spawning at the root on initial source detection (#10623)
pass MixedRealityPlayspace.Transform to Instantiate instead of moving on the next line
1 parent 7115015 commit fcdf493

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Assets/MRTK/Core/Providers/BaseInputDeviceManager.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,8 @@ private IMixedRealityPointer CreatePointer(ref PointerOption option)
302302
{
303303
using (CreatePointerPerfMarker.Auto())
304304
{
305-
var pointerObject = Object.Instantiate(option.PointerPrefab);
306-
MixedRealityPlayspace.AddChild(pointerObject.transform);
307-
var pointer = pointerObject.GetComponent<IMixedRealityPointer>();
305+
GameObject pointerObject = Object.Instantiate(option.PointerPrefab, MixedRealityPlayspace.Transform);
306+
IMixedRealityPointer pointer = pointerObject.GetComponent<IMixedRealityPointer>();
308307
if (pointer == null)
309308
{
310309
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.");

0 commit comments

Comments
 (0)