Make Particles block Raycasts/Linecasts

I want to make my AI be unable to “see” targets behind a smoke screen Particle System. I generally use Linecasts and Raycasts to check AI awareness, but they ignore particles even with World Colliders checked. I can’t use Triggers because I use trigger colliders for something else (flocking and obstacle avoidance).

Is there any way to stop Raycasts when they hit a particle? If not, what would be a good way to implement vision-blocking smoke screens for AI?

1 Answer

1

You can use triggers! Just put the different sets of colliders on different layers, and set up collision detection and masks on your raycasts to make it all work.