Download

Problem with Mouse function not replicating properly

I’m working on multiplayer shooter, and i made a separate mouse control function for my custom mechanics. But there’s a problem, mouse only rotate camera on client 1, but client 2 can’t see that client 1 is turning, this also creates problem with shooting direction. Please help.

Here’s how it looks:

https://1drv.ms/v/s!AmOWr-Yw7oVtgY8DjWXL9cuLG-y_eA

And here’s the mouse control function:

And here’s my replication method:

You wont get these Axis values since they are local.

Also, clients don’t know about each other’s PlayerControllers, thus they can’t even use GetControlRotation…

You will have to manually expose their current Rotation. This can be done by having a Rotator variable replicated inside the Character.
Also, make sure to effectivelly update the pawn’s rotation by, every Tick, update it from this Rotator value.

If you are using a CameraComponent as the final view, always feed the Rotator value from the CameraComponent Rotation.