How do I properly replicate SImpleMoveToLocation?

I have just started learning replication recently.

I am trying to move a player controlled character to a specific location on an interact call automatically. Same kind of idea how in Grand Theft Auto when you want to enter a vehicle you press a key and the character automatically walks to the car door and enters.

I have been searching online and asking chatgpt for solutions and have tried many different things.

The event work on the server no problem. I cannot get it to work for clients no matter what I try.

From my understanding, only the server needs to make the call because movement is already automatically replicated to clients.

Can anyone point me in the right direction please?

The SS I attached is being called on the PlayerCharacter BP.

this is more likely an animation

regarding your current setup. i think MoveTo doesnt work when possesed by a player, it expects an AI. although i could be wrong on that.

what you can use is MoveComponentTo on the root component. or make a custom system

1 Like

You can use Multicast

Multicasting this doesnt work. Been there done that.

This isnt “moveto”, its simplemovetolocation, which doesnt need an AI controller. As i said, it works fine single player and on server

i assume you’re using character movement? which is locally predicted so trying running the MoveTo on the client.

i’m just guessing since i’ve not tried this but im guessing there is some conflict between them

SimpleMoveToLocation is nothing resembling simplicity :wink:

It relies on having UPathfollowintComponent on the controller and if you don’t have one it will create, attach and register one for you.

Now this component relies on having running Navigation System which by default runs only on the server. So you have to go in “Project Settings” → “Engine - Navigation System” and toggle “Allow Client Side Navigation”

Of course you will have to create your navigation mesh by adding a Nav Mesh Bounds Volume in your level for example.

The client character is an Autonomous Proxy so with that setup you don’t need RPCs (events that run on the server). This ugly BP will work on both client and server without the need of special care. Just make sure the point you pick is within your navmesh and is reachable.

Oh! Also make sure that the character has Requested Move Use Acceleration = true otherwise you get in some weird space in code where the server and client desynchronize.

Yep. “Allow Client Side Navigation” was the issue. Thank you.

This was a new one to wrap my head around.

Client makes a Server call, which calls an RPC back to the owning client, but ends up still getting replicated to everyone in game because thats just how UE works with character movement stuff.