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

Follow does not respect playspace transforms #10539

Closed camnewnham closed 9 months ago

camnewnham commented 2 years ago

Describe the bug

When using the Follow solver (in this case to display a hand menu), if the playspace does not have Y-Up, the orientation is solved incorrectly. This occurs whether the object is in the Unity root or MixedRealityPlayspace, which is where I would expect the behaviour to differ (i.e. using world up when in root, using playspace up when parented).

To reproduce

Steps to reproduce the behavior:

  1. Load the FollowSolverExample scene
  2. Move the FollowSolverExample gameobject into the MixedRealityPlayspace
  3. Play the scene
  4. Apply a rotation in the Z axis to the MixedRealityPlayspace
  5. Observe that even though the camera local rotation is 0,0,0, the gameobject with the Follow is rotated.

Expected behavior

"Up" is determined by the playspace transform not the world transform.

Screenshots

Rotating the AdjustmentNode node around the Z axis produces the following: image In this image:

Your setup

Target platform

Discussion

The scenario for this is typically created using world locking tools, where a 3-body orientation mode can use three points to transform the playspace relative to unity space, however can also occur if the playspace is transformed for other reasons.

In the WLT scenario, the hierarchy looks like this: image and the AdjustmentNode is transformed by WLT. Normally this will be minor, as pitch and roll introduced will be minimal. However if a 3-body orienter is used this can be very large.

Is this intentional behaviour that the follow solver always uses world up rather than up as determined by the playspace?

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!