Multiplayer: Have 2 pawns behave like they possess the same object

Hello,

I have a car with 2 seats and 2 players that are supposed to go into the car. I want the driver to possess the car, but I would like the second player to also have the same camera and look and feel as if he was also the owner of the current car.

Currently I am attaching both pawns to the appropriate seats in the car, but only one of them, the owner, will switch to the correct camera and can rotate it. The second player will stick to the camera of their original pawn which is clipping into the car.

Thanks in advance

I haven’t tried this before but it might be possible to just add a camera to the car and use APlayerController::SetViewTargetWithBlend on both controllers to that camera. This method will require an actor, so you will have to wrap the camera component inside an actor and attach it to the car through a child actor component. I believe it should still behave as a normal camera. Player 1 would then be able to use camera controls while player 2 controls must be disabled. If I am right the camera should rotate for both players while 1 player controls it.

2 Likes

Hi, thanks for the suggestion! I don’t even need the cameras for the 2 players to be synced, each should be able to control their own camera. I solved this now by blending to the vehicle camera as you suggested and then process the input for rotating the camera in the player controller manually for both players instead of using “Use Pawn Control Rotation” that I used before. Since the cameras are not replicated, this seems to work well for now.