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

NearInteractionGrabbable missing #8785

Closed Luckypon closed 9 months ago

Luckypon commented 4 years ago

Overview

I have multiple interactables gameObjects that I need to disable and enable a few times. When I enable them back, NearInteractionGrabbable is missing.

Expected behavior

NearInteractionGrabbable should be added automatically on CreateRig() in BoundsControls.cs

Actual behavior

I think the problem lies in CreateRig() in BoundsControls.cs. My objects have a boxPadding that is equals to Vector3.zero, so in DetermineTargetBounds() I never reach TargetBounds.EnsureComponent();

Steps to reproduce

Disable and enable gameObjects with BoundsControls an no boxPadding

Unity editor version

Unity 2019.4.9

Mixed Reality Toolkit release version

MRTK 2.5

STak4 commented 3 years ago

I'm having the same problem on MRTK2.7.2. NearInteractionGrabbable missing even if boxpadding is non-Vector3.zero. (EnsureComponent not working correctly?)

cclo-astri commented 2 years ago

Hi all,

I also encountered the same issue in MRTK 2.7.0

"NearInteractionGrabbable" will disappeared when the Gameobject (which also contains BoundsControl) disabled then re-enable.

In addition, the BoundsControl will become weird even I added back "NearInteractionGrabbable" in Unity Editor runtime.

My current work-around:

  1. Remember the GameObject called OnDisable() (set flag)
  2. Remember the final working BoxCollider size
  3. In OnEnable(), check flag is set or not. If set, do the following 3 things:
    • Manually set back the memorized BoxCollider size
    • Call BoundsControl's "CreateRig()"
    • Manually add back "NearInteractionGrabbable"

Please help.

Thanks.

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!