# Move to location doesn't work for spawned actors

**URL:** <https://forums.unrealengine.com/t/move-to-location-doesnt-work-for-spawned-actors/468163>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [July 14, 2020, 7:06pm UTC](https://forums.unrealengine.com/t/move-to-location-doesnt-work-for-spawned-actors/468163 "2020-07-14T19:06:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Niaphim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Niaphim](https://forums.unrealengine.com/u/Niaphim)\
**Post date:** [July 14, 2020, 7:06pm UTC](https://forums.unrealengine.com/t/move-to-location-doesnt-work-for-spawned-actors/468163/1 "2020-07-14T19:06:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![EvilCleric](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EvilCleric](https://forums.unrealengine.com/u/EvilCleric)\
**Post date:** [July 14, 2020, 8:34pm UTC](https://forums.unrealengine.com/t/move-to-location-doesnt-work-for-spawned-actors/468163/2 "2020-07-14T20:34:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Niaphim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Niaphim](https://forums.unrealengine.com/u/Niaphim)\
**Post date:** [July 14, 2020, 10:00pm UTC](https://forums.unrealengine.com/t/move-to-location-doesnt-work-for-spawned-actors/468163/3 "2020-07-14T22:00:57Z")

</div>

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

 ![307215-unreal-movementbug.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/8/5/f8524cbdc5629bb68c3519f6f5411f799715db43.png)

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.

---

<div class="post-metadata">

**Author:** ![EvilCleric](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EvilCleric](https://forums.unrealengine.com/u/EvilCleric)\
**Post date:** [July 15, 2020, 3:23am UTC](https://forums.unrealengine.com/t/move-to-location-doesnt-work-for-spawned-actors/468163/4 "2020-07-15T03:23:08Z")

</div>

Create a new AIController BP and:

 ![307227-2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/7/c/27c28f71dc4ca0f63e6c26fdbc89304a705b5f09.jpeg)

In your pawn/character set the ai controller:

![307228-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/5/a/b5ab7ad0a966cedf25a33a991487ef861b790ad3.jpeg)

---

<div class="post-metadata">

**Author:** ![Niaphim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Niaphim](https://forums.unrealengine.com/u/Niaphim)\
**Post date:** [July 15, 2020, 7:38am UTC](https://forums.unrealengine.com/t/move-to-location-doesnt-work-for-spawned-actors/468163/5 "2020-07-15T07:38:01Z")

</div>

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!

 ![307235-unreal-movementbug-works.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/6/a/26a75fb49c9a0f7aac4045874fe46b47caf6c955.png)

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!

---

<div class="post-metadata">

**Author:** ![loneduckll](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@loneduckll](https://forums.unrealengine.com/u/loneduckll)\
**Post date:** [March 24, 2022, 1:44am UTC](https://forums.unrealengine.com/t/move-to-location-doesnt-work-for-spawned-actors/468163/6 "2022-03-24T01:44:18Z")

</div>

Just to add onto this one there is another way if you are using a character for your enemy.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/9/3/293822da83a3438a97ef0383820265203e40449f.png)

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