HI,
I have a UI Button.
Can I attach a hover event listener to it like “onClick.AddListener()”?
Or how to create a hover event for a button in new UI?
HI,
I have a UI Button.
Can I attach a hover event listener to it like “onClick.AddListener()”?
Or how to create a hover event for a button in new UI?
Very simple you can attach an Event Trigger ( Script ) to your GameObject.
Hovering in out of that object will trigger your specified function.
You need to write your own script that implements the events IPointerEnterHandler and IPointerExitHandler, then attach it to the button object.
Add an EventTrigger (Pointer Enter type).
Change Transition of Button component to “Sprite Swap”