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

ManipulationHandler -> OnHoverExited "crashes" the pointer (in editor)

Open KarlUweMartin opened this issue 7 years ago • 10 comments

Describe the bug

I wired a method (toggle UI elements) to HoverEnter & HoverExit. Now if I aim the hand ray on the object OnHoverEnter correctly enables my UI. But when I stop aiming at the object, my hand ray vanishes. After that, I can't use my hand ray anymore. It only works again, when I use near interaction. Everything seems to work on HoloLens 1 (release build), but it still looks glitchy sometimes. HoverExit seems to interfear with the pointers raycast in a strange unexpected way.

Expected behavior

Call the methods wired to HoverEnter & HoverExit without breaking my pointer

Your Setup (please complete the following information)

  • Unity Version 2018.4.2f1]
  • MRTK v2.0.0 RC2.1

Target Platform (please complete the following information)

  • HoloLens
  • Unity Editor

Additional context

Add any other context about the problem here.

KarlUweMartin avatar Jul 16 '19 14:07 KarlUweMartin

@thalbern, have you ever seen anything like this before? I just tried this out on both latest mrtk_development and also on RC2.1 and wasn't able to repro this with a really simple scene that looks like:

  1. A cube with a manip handler that had On Hover Exited.
  2. It calls a script that looks like:
public class HoverHandler : MonoBehaviour
{
    public void OnHoverEntered(ManipulationEventData manipulationEventData)
    {
        Debug.Log("Hover entered");
    }

    public void OnHoverExited(ManipulationEventData manipulationEventData)
    {
        Debug.Log("Hover exited");
    }
}

@KarlSupertramp do you have any other details on any other interesting things happening in OnHoverExit that might be leading to this, or otherwise have a min repro scene/project that we can take a look at?

wiwei avatar Jul 17 '19 16:07 wiwei

@wiwei This...

public void ToggleCloseButtonOnGaze(bool active) {
            if (closeButton != null) {
                closeButton.transform.DOKill();
                if (active)
                {
                    closeButton.transform.DOScale(1, .5f);
                }
                else {
                    closeButton.transform.DOScale(0, .5f).SetDelay(1);
                }
            }
        }

... is the method, that's called by the HoverEvents. I'm using the DOTween Plugin for smooth tweening transitions. I doubt that it has anythig to do with DOTween, but my pointer disappears after the DOScale() coroutine is done. Like I said, it's a strange bug.

EDIT: Sorry for the bad code format

EDIT by @wiwei: Adding csharp formatting, horray!

KarlUweMartin avatar Jul 18 '19 09:07 KarlUweMartin

I tried scaling my UI without the DOTween Plugin, with the same reslut. As soon my UI reaches localScale = Vector3.zero, my pointer breaks.

rough

<- This is the setup of the UI (Close button)

KarlUweMartin avatar Jul 18 '19 09:07 KarlUweMartin

Update: It works when I disable the NearInteractionTouchable component

KarlUweMartin avatar Jul 18 '19 09:07 KarlUweMartin

Sweet, I'll take a look at this next up

wiwei avatar Jul 20 '19 00:07 wiwei

Ah, I misread the previous part - @KarlSupertramp,is that last image you shared slightly cutoff (i.e. is it supposed to Manipulation Handler as one of the components on the object?)

To help reduce a little back and forth, maybe do you have a basic scene (i.e. single button) that you could share out that happens to repro this?

wiwei avatar Jul 24 '19 21:07 wiwei

Removed the label while we wait for more information

wiwei avatar Jul 30 '19 00:07 wiwei

I can't share any actual code/project files, I'm sorry. But to repo this, just create a button with the compontents shown on the picture:

My pointer always breaks, if I set the scale of the whole GameObject to 0. This does not happen, when disable the NearInteractionTouchable.

KarlUweMartin avatar Jul 31 '19 14:07 KarlUweMartin

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.

stale[bot] avatar Feb 20 '20 02:02 stale[bot]

This issue has been closed by an automated process because it is stale. If this is still an issue please add a new comment with more recent details and repro steps.

stale[bot] avatar Mar 21 '20 04:03 stale[bot]