So I have a helicopter in my multiplayer game.
When it’s moving with some velocity > 0, and a client character is on top of the helicopter (not possessing it, just riding on it), the client experiences significant jitter on his screen.
Now, I expect this is normal since there is replication delay. But how do you go about fixing this?
My attempt was to detect when I am on top of the helicopter (through a OnHit collision), and then do an interpolation in the Tick function like shown below, but it doesn’t seem to be doing anything…Any thoughts?
It might be a long shot, but I had exactly this recently, and it turns out that disabling the player collision ( on the player ) fixed it. ( I had a piece of code to just hold the player in place )
Thanks for the suggestion.
Just tried this, and it didn’t seem to work.
I didn’t attach the character on the helicopter though (because this would interfere with the gameplay).
FYI, I tried to attach the character to the helicopter while it’s moving (using the AttachToActor function), and the jitter is significantly reduced. But again, I don’t want to do this because the player should be able to freely move.
It might be a long shot, but I had exactly this recently, and it turns out that disabling the player collision ( on the player ) fixed it. ( I had a piece of code to just hold the player in place )
Hello! I found a solution to properly replicate vehicle movement for the client, eliminating delays and stuttering. Simply change the Replication Angle Lerp value from 0.4 to 0, and it works perfectly!
Where to find this setting?
Go to Edit → Project Settings
In the left menu, navigate to Physics
Scroll down to the Replication section
Find Replication Angle Lerp and change its value from 0.4 to 0
This change disables automatic rotation smoothing, ensuring that the vehicle’s rotation is replicated instantly and without jitter between the client and server.
This happens because you’re probably attaching the player actor directly to the helicopter. To fix this, you need to attach the player’s mesh to the vehicle’s mesh.