Network Jittering On Client

I have a jetpack system. The server/listener is buttery smooth but the client experiences some up and down jittering while flying. I tested this with blueprint and cpp with the same results so my assumption is I am using networking wrong.

Here is the code

There is a bit more going on here. I would recommend watching this livestream for high-level explanation.

As far as I can see, there are two mistakes here and there are two ways to fix it. I hope the easy way would be good enough for you, otherwise it is quite a deep rabbit hole.

THE EASY WAY
I believe FireJetpack_Implementation is not firing on the server. So server thinks the character is Falling, not Flying. Please double check that the mode in character movement on server is set to Flying on both client and the server.

THE PROPER WAY

What is happening here, is that server is correcting client, because according to it, it should be falling, not flying upwards. You might be asking why is this not happening while normally walking or jumping? It is because the normal class already has Movement client/server side prediction implemented for those movements. It is not simple to do, if you are experienced in C++ reading the Character Movement Component will give you good insight to what is going on. I have done replicated custom movement before and it requires a quite a lot of work.

Definitely take a look at FNetworkPredictionData_Client and FSavedMove_Character. You can use one of the custom movements replication bits to indicate if player is using jetpack, which should reduce the jitter by 99%.

Good luck!

Please mark as answered if you found this useful