How can I have multiple players control one pawn and show characters inside?

A blueprint is a class. You can create multiple instances (actors) from the same class; they will be independent.

The ACharacter class has a lot of replicated movement functionality, as well as skeletal mesh animation hook-ups. However, a Character moves noting at all like a boat, so I would recommend against making the boat based on Character. The CharacterMovementComponent does a bunch of stuff about air jump control and trying to seat itself onto surfaces (rather than in water bodies) and such – I don’t think it’s a good match.

A blueprint is a class. For each player, there will be a PlayerController object instance on that players computer, as well as on the server. For each player, there will also likely be some Pawn instance – on each of the player’s client computers, as well as on the server. And, finally, there will be a boat instance, which can be a regular actor, perhaps with Simulate Physics turned on, and perhaps with some custom MovementController that you yourself implement.

There are only three classes here: The “player controller” class, the “player pawn” class, and the “boat” class.

This depends entirely on your specific gameplay mechanics. If players are just “assigned” to boats, then you can keep a property on the player controller (or pawn) which is “MyBoat” and just set it when spawning. If you are more like an open world game, where players walk up to a boat, and “press E to get in,” then the action you implement for entering would assign this boat property to the pawn, or controller. (I’d probably put it on the controller, to be honest.)

Typically your UI is some widget blueprint, and the player controller will create the UI instance and add to the player screen, only on the machine where that controller is local. You don’t want a server to have four copies of the UI! The UI typically isn’t involved much in controlling characters, although it can generate RPCS by calling the player controller and the player controller in turn issuing those RPC events to the server (where the server player controller instance will receive them.)

1 Like