# AI move to Multiplayer

**URL:** <https://forums.unrealengine.com/t/ai-move-to-multiplayer/451449>\
**Category:** XR Development\
**Tags:** move-to-location, unreal-engine, Blueprint, question\
**Created:** [June 29, 2019, 10:46am UTC](https://forums.unrealengine.com/t/ai-move-to-multiplayer/451449 "2019-06-29T10:46:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stocker\_00](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Stocker\_00](https://forums.unrealengine.com/u/Stocker_00)\
**Post date:** [June 29, 2019, 10:46am UTC](https://forums.unrealengine.com/t/ai-move-to-multiplayer/451449/1 "2019-06-29T10:46:29Z")

</div>

I’ve got out of body working in blueprints. I have had the ai spawn at players location in VR and ai move to location in world in single player to test game play to see if what I wanted would work.

Now I’m adding multiplayer and have the ai spawn on server and head toward move to location in world. But it only gets halfway to location and stops. I’ve tried to see what if I multiplied it by 2. It almost got to location and then rubber band back to half distance.

Everything is set to switch has authority and also have custom events which are server replicated and multicast, with the destination as the teleport destination.

I’m Stumped, Any help would be appreciated

Regard  
Sean

---

<div class="post-metadata">

**Author:** ![Lardo\_Deepdelver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lardo\_Deepdelver](https://forums.unrealengine.com/u/Lardo_Deepdelver)\
**Post date:** [June 30, 2019, 9:02am UTC](https://forums.unrealengine.com/t/ai-move-to-multiplayer/451449/2 "2019-06-30T09:02:23Z")

</div>

do you run the ai on client and server?  
because it shouldn’t, only the server should move the ai and the client gets the replication

do you spawn the ai only on the server and then let replication create it on the clients?

On the server it behaves correctly?

---

<div class="post-metadata">

**Author:** ![Stocker\_00](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Stocker\_00](https://forums.unrealengine.com/u/Stocker_00)\
**Post date:** [June 30, 2019, 9:34am UTC](https://forums.unrealengine.com/t/ai-move-to-multiplayer/451449/3 "2019-06-30T09:34:22Z")

</div>

I run the ai on server. As that replicates to all clients. I use switch on authority, and us server replicated reliable. The client is putting in the destination as that is where the ai has to move to. It get halfway to destination and then stops. I’m thinking it might be something to do with world origin composition.

---

<div class="post-metadata">

**Author:** ![Lardo\_Deepdelver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lardo\_Deepdelver](https://forums.unrealengine.com/u/Lardo_Deepdelver)\
**Post date:** [June 30, 2019, 11:47am UTC](https://forums.unrealengine.com/t/ai-move-to-multiplayer/451449/4 "2019-06-30T11:47:47Z")

</div>

> The client is putting in the destination

how does that work?  
RPC to server  
is that value changed later on  
would suggest monitoring the target

---

<div class="post-metadata">

**Author:** ![Stocker\_00](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Stocker\_00](https://forums.unrealengine.com/u/Stocker_00)\
**Post date:** [June 30, 2019, 2:14pm UTC](https://forums.unrealengine.com/t/ai-move-to-multiplayer/451449/5 "2019-06-30T14:14:40Z")

</div>

Because its vr and out of body move to location and then teleport once ai gets to location, the value is probably changing. That is why I think it may do with world origin composition. Also the destination is a hit target from the vr teleportation arc. I’ve also put a marker at hit location to see if that is the problem. but the marker spawns at location. And I have tried to use that on the server side as destination and yet still only get halfway to location and stops.

I’ll keep working the problem to find the solution. any suggestions may lead to a solution  
Regards  
Sean

---

<div class="post-metadata">

**Author:** ![Lardo\_Deepdelver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lardo\_Deepdelver](https://forums.unrealengine.com/u/Lardo_Deepdelver)\
**Post date:** [June 30, 2019, 8:06pm UTC](https://forums.unrealengine.com/t/ai-move-to-multiplayer/451449/6 "2019-06-30T20:06:45Z")

</div>

did it ever work (not in multiplayer) or is that new behavior,

what’s your acceptance distance on the go to command?  
maybe it already thinks it reached the target

are you using a behavior tree, where the target gets set on the blackboard?

---

<div class="post-metadata">

**Author:** ![Stocker\_00](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Stocker\_00](https://forums.unrealengine.com/u/Stocker_00)\
**Post date:** [July 1, 2019, 5:33am UTC](https://forums.unrealengine.com/t/ai-move-to-multiplayer/451449/7 "2019-07-01T05:33:17Z")

</div>

here is a video of it working. [UE4 Dungeon Update in VR (Loud Explosions sorry) - YouTube](https://youtu.be/H3OFI--Jgeo) .I’m not using behavior tree. just simple move to in the ai blueprint.

---

<div class="post-metadata">

**Author:** ![BGProductions](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BGProductions](https://forums.unrealengine.com/u/BGProductions)\
**Post date:** [March 21, 2024, 1:15am UTC](https://forums.unrealengine.com/t/ai-move-to-multiplayer/451449/8 "2024-03-21T01:15:58Z")

</div>

For anybody confused. The server has to set the location to move to and run the move to function. Then your character movement component should already be replicating movement, so all your doing is calling the logic on the server so it is in sync on all clients.
