I’m writing a tower defense game, and I’m using quads as tiles for tower placement system. All my tiles have onMouseDown() method in them that executes tower placement code. I also have a capsule collider (set as a trigger) on my turrets checking if there are any enemies in range. The problem is when I place a turret the collider blocks nearby tiles from being clicked like this: http://i.imgur.com/UqillL7.png . My question is: is there any way to stop the trigger from blocking the tile?
Most likely too late, but for everyone searching: The easiest method would be to put the tower on the “ignore raycast” layer. Then it should be ignored by mouse clicks, as these work per raycast.
Also (see here: Unity - Scripting API: MonoBehaviour.OnMouseDown() ) you could just set Physics.queriesHitTriggers to false, which leads to trigger colliders being ignored by OnMouseDown.
The advanced version of this would be to implement the mouse click yourself with a raycast (loads of tutorials online) and define different layers it should hit, which could then be changed depending on game state.