OnPointerEnter is inconsistent, what to do?

Hey everyone. so I’m making a card game.

And I’ve been using OnPointerEnter for my tooltip system and to detect when a card is hovering above an enemy target.

Well… I’ve been pulling my hair out trying to figure out why OnPointerEnter only works sometimes unless I change the enemy collider in play mode. That change can be as insignificant as changing the size by 0.0001 as long as I change it mid-play mode then everything works.

Note: I have a raycaster on the camera, I do have 2D colliders on enemies, and “Is trigger” is true on them.

I don’t know what to do. Please help.

I have also experienced OnPointerEnter working a bit like the weather, and I no longer reach for it. Use a raycast instead I’d say. I usually create a “mouse events” layer where I place my mouse-events-colliders, and then exclude them from physics. Make the raycast only check for those layers. :slight_smile: