Possessing a pawn (vehicle) in a multiplayer session

I am trying to setup a multiplayer game where clients spawn as a first person pawn and I want them to be able to use vehicle pawns.

I followed this tutorial to setup my vehicle as a secondary pawn you can possess:

https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/PossessPawns/Blueprints/index.html

So Single player wise, everything works well but when I try using it in a multiplayer session, I have some problems:

  • If I use the vehicle as the listen server, everything is fine.
  • If I use the vehicle as the client, it shakes but doesn`t move (as if it was moving but getting replicated back to what the server has since I’m guessing the server is the owner of the object?)
  • Also if I try moving the vehicle as the client for 3 sec, the client gets disconnected.

So I am aware that this tutorial wasn’t made for a multiplayer game but if I wanted to make this work, how should I do it?

You need to make sure your movement events are called on the server instead of the client. This can be tested using the isAuthority call. Only the server will have authority. On your events check if they replicate to the server.

I just took a quick look and it seems that key input events can’t be replicated so
I would suggest having the key input event call a custom event that is replicated. then have all the movement logic called by the custom event instead. That would allow it to replicate properly.