After doing many tutorials and workshops for unreal engine i’m trying to create a simple fps game with a simple multiplayer mechanic … But now im Stuck!
The Problem:
I cant replicate the camera movement (up/down) … I think its called “pitch” … I tried so many things, but nothing worked for me… On server-side everything is fine, but if i use my mouse on the server the client can only see the left-right-rotation.
Still learning multiplayer; however, I believe your GetControlRotation is getting the rotation from the clients “copy” instead of getting this information from the server or that which is running the EventTick. Thus, try the GetControlRotation off the EventTick event and pass that result into Server_X and Client_X.
Pitch is already replicated through a hidden variable called RemoteViewPitch.
As far as I’m aware the only way to access it by default is to use function “GetBaseAimRotation” instead of “GetControlRotation”. With this method you don’t need to replicate anything.
The caveat of this method is that RemoteViewPitch is compressed when replicated so it only updates in ~1.4 degrees increments. If you want smoother results, you either have to implement a smoothing system onto that variable, or replicate your own pitch variable with precise values.
every time you get a new rotation value, change the value of your current rotation value by some amount every tick (0.1 degrees for example).
you can use the tick delta to make sure the smoothing is the correct speed across frame rates.
But in this way it still cause the inevitable aim delay, no matter how it’s smooth. So is there some other way to solve this issue to fix the Network Aim offset(yaw)?
btw I use the following method
but it still have the delay