Obstacle with flashbang

Hello guys, I need help, how can I make the flashbang grenade not work when there is an obstacle between the player?

You can run a single line trace from your characters “eyes” to the location the flashbang is at. If the trace hits nothing or the flashbang then you run the effect, if it hits something else you know theres an obstacle and hence you don’t run it.

You can read more about line traces here:

Worked perfectly. Thank you Bariudol.