AI having inconsistent behaviour

I have an AI set up. It’s not using a behaviour tree, it’s just a simple blueprint. I have some ranged enemies that have some pretty basic behaviour such as: See Player > Attack Them, Can’t See Player > Simple Move To Closer. etc.

However, this AI acts really strangely when it is spawned into the level Via blueprints. If it cant see the player, instead of moving closer it just twists and turns randomly on the spot, even though it was capable of moving before.

The blueprint doesn’t seem to advocate for this behaviour at all. As a matter of fact, these problems go away if I hand-place the enemy in the level. Even though it’s the exact same behaviour.

I’m not sure why spawning in enemies would cause them to bug out, as opposed to placing them into the level by hand. Is there a setting I am missing here, or is this simply as bug?

Have you tried setting the “auto posses AI” in the character blueprint? If you haven’t, you might try setting it to Placed in World or Spawned and see if that solves your problem.

Unfortunately this isn’t the problem. The AI comes to life and functions somewhat how it should. But encounters issues when trying to move within a certain distance of the player. So it’s not completely immobilized, it just doesn’t work how it should, even though the hand-placed versions do.

which note do you use when spawning via bp’s? spawn actor from class or spawn ai from class ? did you set up the navmesh right?

Hi Erytriel, I can only determine that this issue was some sort of bug. I duplicated my A.I in the content browser and deleted the old one. Suddenly it works perfectly. I couldn’t even begin to imagine where this bug was rooted, I can only assume there was a compilation error or something. No idea.

Sadly, I can only conclude that this issue was a bug. I duplicated my Enemy Character Blueprint in the content browser, deleted the old one, and replaced the references. It now works perfectly. I can only recommend that people suffering the same issue to do the same. I can’t conclude where the bug was rooted, but this seemed to fix it for me.