AI-Controlled Pawns Not Moving When Spawned

Let me preface this by saying that I’ve certainly Googled this issue and seen that it’s happened to a number of people in the past. Auto Possess AI is set to “Placed in World or Spawned” on the pawns in question, I’ve confirmed that they are spawning with the default AIController, and using SpawnAIFromClass instead of AI MoveTo does not work unless “No Collision Fail” is checked. Aside from that, though, the results are no different. I’ve tried creating my own AIController BP class and using that, as well; no difference. I am not using a Behavior Tree on these actors. Attaching a dummy BT to them has produced no changes.

And as you probably guessed, pawns that have been pre-placed in the level move just fine. Hopefully someone is able to help me find a solution to this; it’s plagued me across multiple projects. Here is the section of code that spawns the actors:

It possible when you spawning your enemy, it get stuck to the floor and prevent them from moving, while placing them just snap them correctly on the floor.

You could try to reduce the height of the capsule collision or some condition to always have a correct z position on the floor.

1 Like

I tried reducing their capsules by various amounts…no dice, I’m afraid. Forcing their locations to be a certain Z-height didn’t help, either. When I look at the positions of these pawns after they spawn, they’re all above the ground with Z-positions of around 90 units by default. The pre-placed pawns have a Z-position of 88 units, but forcing that onto the spawned pawns makes no difference.

I should also mention, I don’t see anything amiss in the AI debugger. The information for pre-placed pawns and spawned pawns is identical, aside from the spawned pawns’ “Path following” state never changing from Idle to Moving.

are you immediately doing a move to after the spawn ?

try to add a delay before starting the move to. and check the output log for any warning.

1 Like


make sure you set this to placed in world or spawned, and assign the AI controller class as well

Auto Possess AI is set to “Placed in World or Spawned” on the pawns in question, I’ve confirmed that they are spawning with the default AIController

From the second sentence of my initial post.

The move is being triggered by a looping timer that’s 3 seconds long. Here’s the code that handles the movement:

…And looking at that code again has made me realize what an idiot I am :joy: I meant to have the spawned pawns open the gate when they spawn, but it must’ve slipped my mind. Thank you so much for your help.

1 Like

we learn everyday :innocent: , even me after 6yrs on unreal didnt know we could create an event from your timer and select our event, i always drag pin to the custom event. Now my code will be less messy !

1 Like

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