Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FollowMeToggle's auto-follow breaks if the component is ever disabled #10619

Closed
kevinfoley opened this issue May 27, 2022 · 0 comments · Fixed by #10620
Closed

FollowMeToggle's auto-follow breaks if the component is ever disabled #10619

kevinfoley opened this issue May 27, 2022 · 0 comments · Fixed by #10620
Labels

Comments

@kevinfoley
Copy link
Contributor

Describe the bug

FollowMeToggle has an AutoFollowAtDistance feature which breaks if the FollowMeToggle component is ever disabled and re-enabled. This is because the AutoFollowAtDistance property setter checks if the autoFollowDistanceCheck coroutine instance is null before starting the coroutine. If the instance is not null, the coroutine is not started.

However, in Unity, the fact that a coroutine instance is non-null does not indicate that that coroutine is actually running. If the component is disabled, the coroutine will stop but not become null. When FollowMeToggle is re-enabled, the autoFollowDistanceCheck coroutine is not restarted because the previous instance is non-null, even though it is no longer running.

To reproduce

Steps to reproduce the behavior:

  1. Add a Near Menu to a scene
  2. Select the Near Menu in the scene hierarchy
  3. In the Inspector, find the "Follow Me Toggle" component. Enable "Auto Follow At Distance"
  4. Enable Holographic Remoting for Play Mode (Mixed Reality > Remoting > Holographic Remoting for Play Mode)
  5. Put on the HoloLens and start the Holographic Remoting app
  6. Start the scene in the Unity Editor
  7. Walk away from the Near Menu to verify that the auto-follow behavior works as expected
  8. In the Unity Editor's Inspector, without stopping the scene, disable and re-enable the "Follow Me Toggle" component using the checkbox to the left of the component name
  9. Pin the Near Menu and try walking away from it again. Notice that the auto-follow behavior no longer works.

Expected behavior

"Auto Follow At Distance" behavior will continue to function after disabling and re-enabling the component.

Your setup (please complete the following information)

  • Unity 2020.3.34f1
  • MRTK Version 2.7.3.0 (this issue should apply to all versions of MRTK)

Target platform (please complete the following information)

  • HoloLens 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant