Control multiple pawns at once

Hello everybody,

for my game I need a player to control two pawns at the same time, with the same input (e.g. by pressing W, I want both of them to move forward).
Since a player controller can only have one pawn attached, I tried spawning a second player controller, and possess the also spawned second pawn with it.
Both controllers print the right pawn on the screen while debugging the Input Event, but only one of them actually moves.

Do you have an idea why this happens, or maybe what is a better way to archieve the effect I’m looking for?
Thank you for your help!

The part where I spawn pawn and controller:

The incorrect debug:

Oh boy, that is a unique one. From your test, I believe PlayerControllers are mapped 1-to-1 with players and therefor you’d need 2 sets of input. The “general” way to handle “one player” controlling “two or more pawns” is through a slightly different manner. Most games that need to do this, have a “PlayerPawn” (spectator pawn or something that allows them to be “just” a camera) and 2 “Unit” pawns (as I call them). The “PlayerPawn” has a pointer/reference to the “Unit” pawns and as it receives input it forwards this input to it’s units. How you handle that, is all up to you.

Thank you for your reply!
I tried using two kinds of pawns, the control pawn has an array of the two other pawns. Unfortunately, their “Add Movement Input” does nothing when it’s called (they are supposed to move with the FloatingPawnMovement component). Do you know a solution for this?

Sorry for the late reply, how are you calling their addmovementinput method? I’ve only done this method in an rts style game where, the playepawn just sends “commands” and the units act on it. I’m not at my dev pc atm, but the fact that the UnitPawns have AI controllers on them, might prevent you from call it directly, but I doubt it…

I used a custom event and called the AddMovementInput directly from within the pawn.
Apparently FloatingPawnMovement only works when the pawn is possessed by with a player controller. I managed to get the same setup to work by using a DefaultPawn now :slight_smile:

Yeah, I figured it was something like that, haha. Glad I could help, if you’d do me a favor and just check my answer as accepted so other people know.

Trying running PIE with a dedicated server. :slight_smile: