Hello, i have just started setting up the multiplayer aspect of a prototype i am working on, it’s a top down game, i have managed to replicate some simple aspects like animation montages, but now i am trying to replicate a fundamental aspect of the game and am having issues, the character is supposed to look at the mouse position and have it’s orientation controlled by it, but that is not working as intended on multiplayer and i’m not sure what the approach should be, this is how i have my mouse input setup for the rotation, this is in the PlayerController:
and this is in the CharacterBlueprint:
and here is a small clip of the current behaviour:
As you can see, on both client and server, the two characters are following the same mouse inputs in their own instances, which should not be the case, by default the server instance is replicating the character rotation to the client, but not the other way around, what is the best approach here? I am still trying to wrap my head around what should be run on the server and what not.
Example of what i have tried that hasn’t worked:
hi,
sorry had a lot to do lately
will be back tomorrow but i think it has to do with GetPlayerController 0,1,2,3,… 0 should always be the server but i will check that very soon 
cheers 
1 Like
Hello Austrian, thanks for coming back to this, i have realized that part of the issue with the replication where all the players were looking at the same mouse cursor on individual instances had to do with the setup we made for the “turn in place”, i wasn’t able to pinpoint what caused it exactly, but by disabling that i was able to replicate it this way:
So that turn in place is disabled for the moment.
On a different note, i was able to test this online with friends, and one thing that bothered me is that due to Steam’s Spacewar high latencies, that “Look At Mouse” function that is connected to the game tick isn’t working great under high latency, it can get jittery, according to the connection stability/ping, is there a way for me to replicate that where it feels more responsive to the client? Currently the game tick is running the Server event directly, that’s the origin of the problem, i hope this makes sense 
Here i enabled Network Emulation with 50 in/out latency, you can see the problem
I managed to solve part of the problem, the client lag under high pings, this is a client with 100 ping with network emulation:
I figured out that in my case, i needed to make “client prediction”, or at least i think it’s called that way, where the client calculates the mouse hit location and the character lookat rotation, and it transmits this information into the server calculation, which in turn, multicasts that same information to the other clients.
I had to turn my Look At event in the character blueprint into a function, allowing the function to have outputs, then i added a vector and a rotator variables on the output, that would allow me to transmit the information calculated from the function into the server, and so on.