Move to location doesn't work for spawned actors

This is a question that has been posted multiple times, but those don’t correspond to my case.

I have an AI that uses a behavior tree to move around and chase my character.

If I place it in level, everything is fine.
If I spawn it via blueprints, move to location doesn’t work, neither in behavior tree, nor in the AI blueprint.

Auto posses AI is checked to be Placed in world or spawned.
I’ve checked it with a spawn default controller node or calling BeginPlay event once more when possessed.
My behavior tree is running, target location is calculated correctly, Move To Location or Actor node fires and fails.

I’m a bit desperate at this point, will appreciate any help.

Update: Move to Location node returns Failed, Simple Move to Location doesn’t work either.

1 Like

Does the same happens with every other AI or only with this one?

It looks like it. I’ve tried with a freshly created pawn blueprint which is set up like this

As long as the pawn is placed in level, it moves just fine.
If it is spawned, nothing happens. I’ve also tried to attach MoveToLocationOrActor to Event Tick and fixed coordinates, still nothing.

Create a new AIController BP and:

In your pawn/character set the ai controller:

307228-1.jpg

1 Like

It worked! Looks like I didn’t utilize the node properly before, anyway it is the solution, you’ve saved quite a bit of my sanity!

This is my actual (still fairly simple) setup. I’ve tested your setup, it worked, but then I needed to make it work for my Behavior Tree. I’ve replaced my MoveToLocationOrActor node with AIMoveTo and got controlled pawn as input, everything works perfectly now.
Thanks again!

Just to add onto this one there is another way if you are using a character for your enemy.
image

You can use this drop box in the class details to make it work without using a behaviour tree.

3 Likes