activate animations of a UI button from raycast

hi everyone i’ve a script that makes ui elements do the onclick function but i want to call an animation every time the button is highlited and pressed, and the normal way to do it with the event systems doesnt work with raycast, heres my script

I like Leage of Legends how do I make something like that in unreal?