What is the proper way to rotate character with replication?
Hello, thank you for taking the time to read the my issue.
I am trying to manually rotate my character to a replicated rotation variable but i see some jitter on the owning client.
I am using "Play in new editor window" with 2 players and "Run Dedicated Server".
Please see example of issue here: Video showing rotation jitter
As you can see in the video, the replicated rotation works, but is jittery. When using the built in "Use Controller Rotation Yaw" it works silky smooth.
I am trying to rotate like this so I can have more control over it. I would like to add an rInterpTo for example so my character can have rotation lag (smooth rotation lag hopefully).
Again, thank you for any help/insight into this issue.
This is happening, because the Client Fights with multiple GetControlRotation values.
Make sure to only pass ONE Value, and let everyone use that one value.
Here is the Solution that uses the Event Tick. The Control Rotation is set via the InputAxis Turn.
The Character is NOT set to use any Control Rotation on default. So everything is done via the Events.
Local Client tells Server the Control Rotation. That one then Multicasts it to the Network Clients. The Local Client sets the Actor Rotation directly too, so he doesn't fell a lag.
If a Listen Server Calls this, we need to make sure that not any other Server Version of a Network Client calls this, so we make sure the Server Version is Locally Controlled. If that's the case, we skip the Server RPC and directly Multicast and also set the Actor Rotation directly, to fight any lag caused by the Multicast.
I, myself, wouldn't use the Event Tick for this. I would hook the InputAxis Turn up with the Rotation and I would add the Axis Value to the Current Rotation and then use the resulting **Actor Rotation* the same way as I used it in the Event Tick Version. Difference is, the InputAxis Turn is only called locally anyway. So we need no SwitchHasAuthority node and also no extra Server Logic. We can simply call the ServerRPC and the Multicast for Clients and the ListenServer.
But, well, in the end, it's up to you guys (:
answered Apr 18 '16 at 02:03 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here