Character Movement Component Networking Issues

Hello. I’m a little confused about how to get my character movement networked correctly. I’m running into a problem where if there’s a network correction, there tends to be a lot of corrections in a row. This causes two issues: 1, The character’s movement tends to be jittery. And 2, all those corrections can sometimes end up overriding my user’s input and the character gets stuck in the wrong state. Of course, the higher the ping, the worse this gets.

I have a basic example setup that where my character can press mouse 1 and it pulls them towards what they’re looking at. You can check it out here: GitHub - mpeterson2/CMCTest. The 2nd commit is all the relevant code.

I’ve been testing by setting p.NetShowCorrections 1 on a listen server NetEmulation.PktLag 200 on a client, then pulling myself on the client. Pretty much immediately I’m getting corrections and my movement is very jittery. And every now and then I get stuck in the pulling state.

Any ideas what I can do to improve this or what I might be doing wrong? Thanks!

I managed to vastly improve this with a couple small changes:

  • I was calling the Super::MoveAuthonomous before updating my movement component’s variables, so we were always behind by one tick.
  • It seems that CalcVelocity was probably not the right place to call Launch. Moving it to OnMovementUpdated seemed to fix a lot of the jitter

However, I’m still experiencing the issue where if I get a lot of movement corrections, I can still get myself stuck in the pulling state. I can repro this pretty easily by pulling myself towards the moving box or any of the desynced blue boxes once moved (the higher the ping, the easier it is to repro, but I can still get it to happen at 60ms). This one I’m less sure about how to fix, so any insight would be appreciated!