Move an Actor with Mouse, Replicate not working

Hi at all,

i have problems with replication.

I have have a Session, a client can join the session, the Charakter can walk, the client and the server see together the walking of the 2 Charakter.

But now, i want pick up an spwaned Actor in the world with the mouse and want control him with the mouse.
The Mouse to Screen coords ist working, the Actor hangs on the mousecursor. The Server can move the Actor, the Client and the server see the movement, the Client can move a athor Actor and the client see the movement, but the server not see the movement, the Actor stand still.

If i put a function in the Actor that moves it from one vector to an athor vector automaticly without mouse control, server and client see this. Only the movment on the client with the mouse the server can not see it.

I working with own Charakter, GameState and Controller.

My English is not perfect, i hope all can understand what i mean.

UE5.6 Blueprint

Hello there,

First you have to understand that replication is only one way - from Server to Client.

The only way to send data from the client to the server is through a RPC. Note that this RPC can only be called from an actor the client owns (usually the controller or the possessed pawn)

So the reason the server can move and everyone sees it, is because the sever owns all actors.

The reason the client can move and no one else sees it, is because the client is moving its own copy of the object (but replication is only server to client) and the server never knows.

To fix it, you’ll have to send an RPC to the server announcing that you want to move the object and the server should do the moving for you. The movement will be replicated and then everyone else will see it. (including the original mover)

For more information on networking please read: Programming Network Multiplayer Games for Unreal Engine | Unreal Engine 5.7 Documentation | Epic Developer Community

Thx for the answer, i found the problem.

I forgott to take the local controller from the client, the Actor becomes no coords.

Thats Murphy’s Law, 2 Days i search for the solution, and 10 Minutes after i write this post i found it.