OnPointerEnter events blocking buttons from highlighting/triggering

I have a canvas element and I want to do something specific when I mouse over the entire canvas. I essentially enable a specific script when the pointer is entered.

I have tried creating a script that implements IPointerEnterHandler and IPointerExitHandler and then putting the following:

public void OnPointerEnter(PointerEventData data)
{

myscript.enabled = true;
}

public void OnPointerExit(PointerEventData data)
{

myscript.enabled = false;
}

This works great! The script gets enabled and disabled as expected… BUT as long as the script that implements IPointerEnterHandler is enabled, all of the BUTTONS that are on that canvas stop working. Hovering over them doesn’t highlight the button. If I disable the IPointerEnterHandler script, the button starts working normally as expected and is highlighting properly.

The same thing happens if I add event triggers for OnPointerEnter and OnPointerExit instead of implementing the handler interfaces.

It seems like the pointer event is getting “eaten” by the script on the canvas - how can I prevent this?

1 Like

bump?

Any news on this?