AI detects player, but then just shoots in one direction

I have AI setup and when they detect the player they start shooting, but then they just shoot in one direction. They all shoot in the same direction and they immediately snap to that angle when they detect me. It wasn’t doing this, but all of a sudden it started and I have no idea why. Anyone else have this problem?

Unlikely. If you need help with the issue, consider posting relevant script.

There is so much code for it. What do you want to see?

These 2.


Oh, it’s you! With the bots that are very difficult to hit with lasers!

Yeah, the bots are a bit hard to shoot (until now LOL). I’m just following instructions from a class I’m taking.

I’m not sure where it’s causing it to do this, it just started happening for some reason.

I recorded a video of what’s happening. It shows it targeting me (the PlayerCarCust_BP_C_0 as the EnemyActor) but then just looks in one direction and starts shooting.

Here’s the behavior tree and the tasks that are in it for the target and shooting aspect:

Focus Task

MoveToLocation Task

Shoot Task

SetFocus does not rotate the character towards EnemyActor.

I recommend adding a service to Shoot that rotates your BT avatar towards EnemyActor

1 Like

I’m brand new to this, I’m searing for a rotate bp but don’t see anything that matches. Can you give me an example?

If no BTService or BTDecorator exists for this purpose by default, then you will have to create it yourself.

1 Like

think that’s above my skill level at this point LOL

1 Like

that seemed to work. although it wouldn’t let me select the EnemyActor target variable which was odd.