OnMouseEnter through colliders

EDIT (FIXED): I fixed it , it was due to the fact that the tower inherited the layer of the tile, being a child of it.(Another solution was to click on the physcis settings and set the raycast to ignore triggers, it will then ignore the range sphere which is trigger) Thanks for the answers :slight_smile:

Hello all!
I’m making a tower defense game in unity indie , and i’ve set up all the turret system and the grid system (there’s no free placement of the towers) and I met a big problem.
Each square of the grid highlights and is selected when you hover it , and creates a tower when you click on it. This works fine. But on my tower there is a sphere collider, it’s the range of the tower . It’s pretty big and all ennemies who enter it are shot at ( it’s a “is trigger”). As soon as the tower is created, this collider is obviously created with it, it’s part of the tower. This collider being big, it seems to block the access to the tile around it ( the tiles of the grid a bit further works still fine ) , meaning I can’t hover any tiles around it , cause the mouse gets on the sphere first , which is in front of the tile. It’s logical, but is there a way to get around this? I tried ignorelayercollision , but no luck with that. (Oh and the tower is child of the tile)
Thanks for reading, I hope you can help me :slight_smile:
Edit: Here’s a screenshot ;

if your camera is orthographic, replace sphere collider with capsule collider, and set it to Y and the height to 10.

Then the orthographic camera’s Y to 9 so the camera is inside the trigger.

Ignore layer should work just fine, but I dont like using it :S

If you use PhysicsRaycastAll it returns an array of hits. This makes it very easy to mask out the sphere collider.