MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

All interactables with Is Global checked are triggered OnClick

Open reddo123 opened this issue 7 years ago • 5 comments

Describe the bug

Any buttons with Interactable.cs attached, Is Global checked and contain an OnClick event are all triggered at the same time when another button is manually selected on air tap/press. Speech commands work fine and only trigger one event.

To reproduce

Steps to reproduce the behavior:

  1. Go to MixedRealityToolkit.Examples > UX > Interactables > InteractablesExamples
  2. Add a SetActive false event to the AnimationButton object
  3. Check the Is Global box under DefaultInteractableStates section on the AnimationButton object
  4. Click Play button to run in the editor
  5. When running click the Button or ToggleButton object. The Animation Button object should then disappear.

Expected behavior

Only the event on the button being manually selected/tapped/pressed should be triggered

Screenshots

Your Setup (please complete the following information)

  • Unity 2019.1.11f1
  • MRTK v2.0.0 RC2.1

Target Platform (please complete the following information)

  • HoloLen

Additional context

I was under the impression the the Is Global setting would only apply to speech commands.

reddo123 avatar Aug 11 '19 03:08 reddo123

@reddo123, can you provide more information about your use case? IsGlobal is meant to allow the Interactable to listen to all input within the scene, whether the object has focus, physical interaction or not. Something like a modal or click anywhere to proceed scenario or press any button. Deselect IsGlobal to have the Interactable only respond to focused or physical interactions.

The "IsGlobal" terminology may be misleading here, understanding the use case will allow us to describe it better.

killerantz avatar Aug 12 '19 16:08 killerantz

Thanks for the clarification. The use case is to have voice commands as global, so the button doesn't have to be focused on to trigger the event. I understand unchecking RequiresFocus is meant for this but this doesn't seem to work, which may instead be where the issue lies.

reddo123 avatar Aug 14 '19 01:08 reddo123

That is a good point, the Requires Focus should cover that scenario. Unfortunately MRTK 2.0.0 RC2.1 had a bug with how speech commands work with Interactable and exactly what you mention here. This Issue #4598 was closed a week after RC2.1 but should be fixed #4695 in the next release.

killerantz avatar Aug 14 '19 21:08 killerantz

@reddo123 now that GA 2.0.0 is released, can you try this scenario again? Thanks!

Troy-Ferrell avatar Aug 28 '19 16:08 Troy-Ferrell

Tested with 2.0.0 and looks to be fixed. Thanks.

reddo123 avatar Sep 02 '19 04:09 reddo123