AI shoot while following path

I have an enemy AI aircraft that follows a spline path. I’d like the AI to be able to shoot back when I’m in it’s sight radius and at a certain distance.

The AI needs to be constantly following the path, so it cannot alter course to pursue me or it’s other targets. It’s ok if it misses, it doesn’t really need to be accurate. This game is more about me shooting them down than the other way around.

Imagine it’s like a strafing run. The plane comes, fires a few bullets, stops firing and moves along the spline, as it loops around, go in for another pass of bullet firing.

I was thinking of maybe doing pawn sense, so that there is a clear cone or frustum in which the AI can see, then only shooting whenever I pop into that sight radius.

I’m not sure if AI perception will work, since that’s mostly focused on free roaming AI, not for those following a path.

I’d love to hear some suggestions on the best way to approach this. Remember it doesn’t need to be crazy accurate.

you could create your own psudo perception by using a cone shape and a overlap event. then create a loop to fire continuously until the overlap ends.

in the below picture i set up an example of how you could accomplish the above. in the script i made the control on whether the enemy can fire is based on the gate, if the gate is open they can fire, if not then they cant fire. its pretty basic and simple.

That’s a really good idea! It simplifies a lot.
Thanks I’ll give that a try tonight after work!

I have it setup but nothing is happening. My print string isn’t showing any hits.

My character is a VR pawn with a capsule collision also set to overlap all dynamic. The cone is definitely making contact with my character.