How to set game object selected within script when hovered

Hi, I wanna use ray interactor and trigger button to call my function, but "On Activate" function has to be called when selected. I don't wanna check the ray interator's "Hover to select" option cause it will disable the interaction between ray and UI canvas. So is there any way to make single game object selected when hovering? Thanks.