microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

ObjectManipulator in a canvas is affected by PokePointer #10097

Closed hermann-noll closed 9 months ago

hermann-noll commented 3 years ago

Describe the bug

The ObjectManipulator should not be affected by the PokePointer, although not explicitly stated in the documentation this is the default behavior in the MRTK examples and is also stated by a comment in the ObjectManipulator source itself. However if a default ObjectManipulator along with a NearInteractionGrabbable is added to a UnityUI object that is part of a MRTK canvas with NearInteractionTouchableUnityUI.EventsToReceive set to Pointer (in order to use the Unity-built-in components) this is no longer the case - poking the object alone will move the object around.

To reproduce

  1. Create a MRTK canvas
  2. Set NearInteractionTouchableUnityUI.EventsToReceive to Pointer
  3. Add a new object inside of the canvas
  4. Add a box collider, an ObjectManipulator and a NearInteractionGrabbable
  5. Start the scene
  6. Poke the object

Expected behavior

The PokePointer should never interact with the ObjectManipulator.

Screenshots

image

Your setup (please complete the following information)

Target platform (please complete the following information)

Zee2 commented 3 years ago

Hi, thanks for reporting this issue.

Does this issue still occur when your ObjectManipulator is not inside a Canvas? We'd like to figure out if this behavior is unique to your situation where the ObjectManipulator is nested inside of a canvas, vs a more general issue with our event system.

Also, is it possible in your use case to avoid nesting the ObjectManipulator inside the canvas? We haven't done much testing on grabbables inside canvases. This isn't to say we don't support it, but it isn't one of our expected usages. More information on this would be greatly appreciated! 🚀

hermann-noll commented 3 years ago

Yes in my tests the ObjectManipulator reacted to the poke pointer only when nested inside a canvas; in the same scene with equal configuration but without a parent canvas the ObjectManipulator reacted correctly.

As far as I see there is no technical reason the ObjectManipulator could be moved outside of the canvas. However this would require major restructuring on our side (thanks to Unity's limitations in regards to prefabs).

Zee2 commented 3 years ago

@RogPodge Is this something you might want to take a look at? You came to mind w.r.t. your work on multiple pointers/pointer architecture, but if it's not a good fit let me know.

RogPodge commented 3 years ago

I can keep this in mind as we start updating our interactables infrastructure, though I'm not sure there's anything specifically pointer related going on here. Maybe it has something to do with the Physics layers?

stale[bot] commented 2 years ago

This issue has been marked as stale by an automated process because it has not had any recent activity. It will be automatically closed in 30 days if no further activity occurs. If this is still an issue please add a new comment with more recent details and repro steps.

IssueSyncBot commented 9 months ago

We appreciate your feedback and thank you for reporting this issue.

Microsoft Mixed Reality Toolkit version 2 (MRTK2) is currently in limited support. This means that Microsoft is only fixing high priority security issues. Unfortunately, this issue does not meet the necessary priority and will be closed. If you strongly feel that this issue deserves more attention, please open a new issue and explain why it is important.

Microsoft recommends that all new HoloLens 2 Unity applications use MRTK3 instead of MRTK2.

Please note that MRTK3 was released in August 2023. It features an all-new architecture for developing rich mixed reality experiences and has a minimum requirement of Unity 2021.3 LTS. For more information about MRTK3, please visit https://www.mixedrealitytoolkit.org.

Thank you for your continued support of the Mixed Reality Toolkit!