This is a short little troubleshooting guide that I wish existed anywhere late last year. This small, stupid bug cost me weeks of grief and the fix was embarrassingly simple.
The Problem #
At the last studio I worked at, we were making an Unreal Engine 5 third-person game with networked play. One feature we had is a common mechanic: two players can get into a vehicle and drive that vehicle around the environment. Very straight-forward design, and the implementation seemed obvious: attach the player actors to the vehicle, move the vehicle, players move with vehicle, done.
But this was the result when played over the network:
Jitter like this usually means the client and server are fighting over who has authority over setting an Actor’s position. Naturally, I figured that, while the server should always have authority here, I could create a Multicast event that makes sure the Player Pawns are parented on server and all clients. But this wasn’t it either.
This vexed me for weeks. Maybe months? I don’t know. Time gets fuzzy on a year-long project.
The Solution #
- Call a Multicast event from the Server
- In this Multicast Event:
- Attach the Player Pawn to the Vehicle Actor (Weld Simulated Bodies isn’t needed)
- Set Actor Enable Collision to False on the Player Pawn
- On the Player Pawn’s Character Movement component:
- Set Movement Mode to None (or Disable Movement)
- Set Ignore Client Movement Error Checks and Correction to True
It was that last bullet point that I just never knew about or saw anybody mention. Somehow I missed that it existed. Great opportunity to go take a walk and wonder what I’m doing with my life, but there was a heat wave at the time.
I hope this saves even one person from my plight.