Replicating a Changing Speed Variable in Multiplayer

Hello all,

I have designed a flight system in a game I’m working on that is constantly, on the event tick, updating the movement speed of the player. The speed changes based on whether the player is sprinting, the character’s pitch angle, and based on the total accumulation of diving over time. The flight feels fantastic and players have really liked it, but when replicated across a network, it gives jitter client-side, especially for players with higher latencies.

What I’m doing is using the a mathematical combination of these different conditions to adjust the value of MaxFlySpeed in the Character Movement Component on the event tick, as well as setting the velocity vector on the event tick as well. These computations are done only on the local computer, the result of which is sent to the server to set server-side as well.

Here’s my current setup to replicate flight speed and course. If I’m a client, I tell the server my updated max fly speed and velocity vector. Not doing so at all causes the player to be unable to exceed the course and speed the server says it should be, and it will rubber band back to the server’s values regardless of what the client does. The Character Movement Component is set to replicate.

I do know that when I am flying in a straight line without any change in velocity or course, the jitter stops. It can be recreated in the editor by the net pktlag command to simulate latency in online play, though the issue first came to surface during multiplayer gameplay testing sessions with friends.