I’m working on a blueprint multi-player game, testing it with a listen-server and one client.
I can not get the client-controlled pawn to move on the server. Now some details:
From all of the information I have gone through I gathered this: the suggested way of handling pawn movement in multi-player is to determine the details of the movement on the client and having the server execute the movement according to those details and replicate the movement to all clients. So the set-up is this:
The server spawns a pawn for each player/machine according some player info passed to the server by the clients. The pawns are then possessed by the respective player controllers, organized by the server.
The Pawns are of the “default pawn” class.
In the pawn blueprint I set up the movement as shown on the screenshot:
The whole thing works when I control the pawn on the listen server. I see it move around on the server machine and on the client. But it does not work the other way around. Which is so strange, because I thought with this set-up the Multicast means that the server carries out the movement for the client version (which it obviously does, the client pawn moves around), then why does it not work for the server version of the pawn?
I can get print-strings that are instigated on the client to show on the server with an event set to “run on server” so I assume I can actually trigger an event on the server from the client, but the pawn does not want to move with a similar set-up either.
Another set-up I tried was to trigger an event from the client to execute only on the server, which in turn sets a vector variable with “rep notify”. The idea was that when the server sets the variable with “rep notify” it would result in all clients to execute the related function, which was to set up to add movement input to the pawn, i.e. move the pawn. But that did not work either.
I really tried many things and looked at many tutorials, the documentation, and forum posts, but I must be missing something.
The pawns are set to replicate.
“Replicate Movement” is checked.
All variations of setting variables and components to “replicate” did not make a difference.
I am lost. So looking forward to some help.