- Home /
OnPointerEnter and OnPointerExit not being triggered
Alright so basically the issue that I've been having is that for some reason a GameObject is interfering with the OnPointerEnter function. I'm pretty sure that OnPointerEnter detects only UI. So that's why I'm extremely confused when seeing that a specific GameObject in this case the PlayerLogic GameObject (which you can see in the screenshot) is for some reason interfering with the detection of UI elements. The reason I believe it is this specific GameObject is because once I do PlayerLogic.SetActive(false); OnPointerEnter starts to work again, and I'm also sure that it isn't any of the children of PlayerLogic because I've tried turning them off specifically and it still didn't work.
Inspector for PlayerLogic
Basic code just to detect whether or not OnPointerEnter is working.
Through a little more testing I've realized that the problem is the Player script, but not the code within the script but rather the Script object itself which once again makes no sense to me. Since when I turn off the Player component OnPointerEnter doesn't work but when I remove the component entirely from the PlayerLogic object it works.
Your answer
Follow this Question
Related Questions
Multi Coloured Buttons 0 Answers
Get current sprite from filled Image PRESERVING ITS TRANSPARENCY 0 Answers
Have UI image float over a gameobject position 0 Answers
How i set image from Raycast hit target object? 2 Answers
UI Image not blocking raycast 3 Answers