We are working on vehicle based multiplayer game and faced the issue where third person camera followed by vehicle has a quite big lag in case when vehicle intended to turn left or right. This issue we noticed also for the vehicle template comming with Unreal Engine where Net mode setup for multiplayer.
Would be good to know how it is possible to overcome that issue somebody faced in own practice. Please note that we have tried to play with camera rig settings but in does not give expecting results.
Thank you.
Hi, I am currently trying to fix this and noticed a few things. First you can erradicate the lag (at least in my case) by switching on “Use Pawn Control Rotation” on the spring arm of the camera. You will have to uncheck any uses of "Use Controller Rotation… " on the root vehicle in order for this to work correctly.
However if you do not want to use the controller rotation directly, there is another option. Use an Event Tick to set the rotation of the spring arm via script, but set the tick group to post physics so the camera update happens after the network correction of the vehicle (because this is whats causing the camera to stutter).
The first case you mentioned is a good solution which overpass the issue, but for our purpose it is not meet the initial requirements.
Related to the second approach suggested by you - I can’t see any difference with TG_PostPhysics flag the small lag is still presents. I’ve also tried out TG_PrePhysics to see the difference and in this case the lag was awful !
So, continuing investigations…
Thanks!
Hi, just to be sure there isn’t a misunderstanding. I used the Tick event in the player controller to update the camera spring arm on the players pawn (the vehicle). Setting the tick group of the player controller, not the vehicle, to post physics did fix the stutter on the camera for me. I did all of this in Blueprints for quick prototyping, not in C++. I imagine this solution will not work if you use the tick of the vehicle.
By the way, you will still notice that the vehicle itself is not very smooth after you did all that, compared to a single player game. The reason being that there is no client side prediction implemented on Chaos Vehicles (and also not announced for 5.1, sadly). So basically the vehicle is not simulated on the client at all and just updating its state when it is receiving an update from the server. A bit like stop motion works.
Let me know in case you find a way how to enable physics simulation on the client side, I could not find a way to get it to work.
This issue is still actual for UE5.1 latest version as well.
Currently Epic changed the bug status as ,WantFix, and intended to back for this depends on importance.