Hi!
I am making a pixel art game, so every little pixel counts.
I have made a Hover and HoverExit function utilizing Rewired for the GameObjects and it works flawlessly, down to the tiniest pixel.
However, problems occur when I am trying to make similar code, but for UI objects instead.
I have 2 buttons lined up next to each other, few pixels apart, and the buttons are not overlapping.
Despite this, if I happen to have an OnPointerEnter called on either of these buttons, and I move the pointer to the other button, the OnPointerExit will not be called.
I got my code all the way down to this:
public void OnPointerEnter(PointerEventData eventData)
{
Debug.Log(currentHover.name + " @ " + ReInput.controllers.Mouse.screenPosition);
}
public void OnPointerExit(PointerEventData eventData)
{
Debug.Log("Exitted");
}
And I can see in the log, that the OnPointerExit is never called on this scenario.
If I hover a button, and then stop hovering it, the OnPointerExit will be called, but not when i hover Button 2 after hovering Button 1.
My buttons look like this:
The yellow image has Ignore Raycast on.
Am I just missing something? Or is there a different, more precise way to check for UI raycast?