adding another ignore raycast or layermask
Found posts on LayerMasks and Ignore Raycast but don't think it is what I need - or at least was unable to achieve my desired effect. Which is: I have mesh colliders on walls so that if my bullet hits them they leave a specific bullet hole or make a specific sound depending on if it is metal, wood, glass etc. this same collider ( tagged "wall") will also prevent the enemy from trying to shoot me through walls. His raycast hits "wall" so he repositions himself. 2 problems with that: 1) the collider doesn't keep the player from clipping through the wall and the enemy's raycast clears the wall easily so can still appear to be shooting at you from behind a wall. So I put a fatter invisible collider to keep the player from clipping through the wall and put it on the Ignore Raycast layer so my bullet holes aren't spawned 2 feet in front of the wall. this solves the player problem but..... and this is what i need help with - is that it doesn't solve the issue of enemies just barely peaking out of a doorway to shoot me because there raycast doesn't hit the fat collider either. So ...the big question is HOW CAN I HAVE THE ENEMY RAYCAST SEE THE COLLIDER ( to avoid it and step out in the open more) BUT NOT ME. I have tried camera culling and layers? I put it on layers so i can't se it put my bullets still hit it even though I can walk right through it. i need the oppoite