Ai damage from behind

I’m trying to make a stealth based game where the ai can only be attacked from behind. I tried to do this with a box collision and making it so that if the collision attached to the back of the ai is hit by my players weapon, the ai actor would be destroyed. This however did not work. Is there a way in which this can be done?

You could try using the dot product. No need for extra collision shapes or nothing like that.

Consider this example for the fps, where when the projectile hits an enemy:

It determines the dot product between the enemy and the player’s forward vector. If > 0, then is an attack from behind else from the front.

You can adapt this principle to your case and change the dot product interval to narrow the allowed attack angle.