AI can't move when spawned

I’m working on multiple projects that require that AI be spawned in the world rather than placed manually. Each of these projects have different AI since some aren’t as complex as others, but the problem seems to pop in every case.

To make sure their behavior is working I usually set up a test map and place an AI in the world.

The placed AI can move without issue, but when the AI is spawned (either in the test map or in game) is it not capable of moving.

This includes falling as well. They just float in the air if they are spawned above the ground.

I am know that the AI is being spawned with a controller. The AI is set to spawn it’s controller when placed in world or spawned, the AI controller class is set properly and I even called SpawnDefaultController() after spawning them to see if that was the issue and nothing works.

I know NavMesh is fine since the AI can walk if it’s placed in the world so I’m stumped.

I’m guessing that this is an issue with character movement rather than AI since the AI even respond to my player but I’ve tried checking their movement every frame to test and it’s always printing NavMeshWalking as it should. They never transition to a falling state when in the air though.

My player character does not have any issue with movement and it is derived from the same base class as the AI so the movement properties are the same.

Is there a setting that I’m missing somewhere?

Thank you for your time!

Update : Setting bRunPhysicsWithNoController did not resolve the issue.

have a look at the AI Debug (Show → Developer → AI Debug). What happens if you possess one of the spawned AIs with your Player Controller?

Are you try to modify this property on your pawn :

288294-ia-controller.png

4 Likes

Yeah I definitely have it set to placed in world or spawned.

I still don’t know what happened, but I deleted intermediate, saved, binaries, and .vs then recompiled and it worked.

How do I do that and is it safe? I don’t want to lose progress and also I have the same issue where ai isn’t moving at all after spawning

1 Like

Thanks but placed in world or spawned worked for me

1 Like