Is there any way to rebuild / refresh AI controller for placed-in-level pawns?

I place AI pawns in the level and when a trigger is overlapped they become active.

Not sure why, but sometimes randomly some of the pawns don’t seem to have their AI controller set. I can see that the blueprint logic is running normally but they just don’t respond to Move To commands.

If I select that pawn in the level and just select a new option in the AI possess dropdown and then change it back (to Placed in world or Spawned), then the AI controller works as expected. So it is like some link to AI controller gets broken and doing this refreshes it.

If I do something else to refresh the construction script that will not “reset” the AI controller though. For instance if I just move the actor or change some other variables that will not fix the problem.

So is there any way I can just refresh or rebuild whatever data is associated with pawns for the entire level all at once, rather than having to click one pawn at a time whenever this issue occurs?

Rebuilding paths does not seem to have any effect.

Or is there any way I might avoid this problem in first place?

Actually, toggling the AI controller possession type does not solve the problem.

I have confirmed that the pawns are possessed and all logic is running on the problem pawns same as the ones who are working. So I cannot say at all what the problem is.

So I will just spawn them at runtime like I was before rather than place the actor in level at design time. So far I have not found any issue with spawning them at runtime.

Okay, found the actual solution.

In project settings you need to increase Max Agents:

This doesn’t exactly explain why in editor sometimes they would not work even though PIE had just started, but I was still consistently hitting this issue at same point while playing through the level. At a certain point, AI agents just don’t path anymore. This solves that problem.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.