MixedRealityToolkit / MixedRealityToolkit-Unity

This repository holds the third generation of the Mixed Reality Toolkit for Unity. The latest version of the MRTK can be found here.
BSD 3-Clause "New" or "Revised" License
403 stars 106 forks source link

[BUG] Object reference not set to an instance of an object : when clicking a button in the CanvasDialog Prefab #857

Closed MaxPalmer-UH closed 3 months ago

MaxPalmer-UH commented 3 months ago

Pressing a button on the Canvas Dialog either directly - using a tracked hand - or indirectly - using a raycast/pointer causes an object reference not set to an instance of an object error in the console.

To reproduce

Import the packages as shown: image

Steps to reproduce the behavior:

  1. Create a project using Unity 2021.3.24f1
  2. Set it up to use OpenXR and the hand interaction profile and meta aim extension
  3. Add a number of input bindings - Microsoft Hand Interaction Profile, Oculus Touch Controller Profile, Valve Index Controller Profile
  4. Enable the MRTK subsystems as shown: (note I have not added with windows speech package) image
  5. Delete the main camera and add a new MRTK XR Rig prefab
  6. Add the Canvas Dialog prefab
  7. Run
  8. Press the canvas dialog buttons either directly using hands or indirectly using a ray/pointer
  9. Console shows an error each time the button is selected/clicked. Button appears to respond to the click as expected (depresses, hear click sound)

image

Expected behavior

No error is shown.

Screenshots

See above.

Your setup (please complete the following information)

Target platform (please complete the following information)

MaxPalmer-UH commented 3 months ago

This was an issue with not being familair with how the dialog system is meant to work. Using the dialog pool in conjunction with the prefab works fine.