ManipulationHandler -> OnHoverExited "crashes" the pointer (in editor)
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.
@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:
- A cube with a manip handler that had On Hover Exited.
- 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 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!
I tried scaling my UI without the DOTween Plugin, with the same reslut. As soon my UI reaches localScale = Vector3.zero, my pointer breaks.
<- This is the setup of the UI (Close button)
Update: It works when I disable the NearInteractionTouchable component
Sweet, I'll take a look at this next up
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?
Removed the label while we wait for more information
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.
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.
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.