How can I control 2 pawns with 1 controller?

I’m trying to control 2 pawns with each thumbstick on my 360 gamepad. I’ve managed to setup the inputs correctly when the pawns are in the scene by themselves. However, when I spawn the first one via the player spawn and spawn the other pawn through the level blueprint I can’t control the one I spawn through the level blueprint. It is stuck in the air and won’t listen to any input.

I’ve checked the answers from similar questions but haven’t been able to make anything work.
I’m pretty new to UE4 so there might be something small I miss, so I’m glad to get as much help as possible.

Hey Grillet,

You need to make sure that the second pawn you spawn has a Player Controller possessing it, or it will not respond to input using the CharacterMovement component. Since you are attempting to use two pawns with the same gamepad, you’ll need to give the second pawn its own Controller; Player Controllers can only possess one pawn at a time. I was able to set this up by spawning a second Controller, then spawning the second pawn, and possessing the second pawn with the second controller, like this:

I have this set in the main Controller I’m using for the first pawn rather than the Level Blueprint, because it’s generally cleaner to avoid using the Level Blueprint for things that do not pertain specifically to that level, but this should work in the Level BP if that’s how you prefer to do it. Note that this is a very basic setup and can be elaborated on depending on your goals.

Hope this helps! Let me know if you have any questions.

Thank you. Works just fine now :slight_smile:

I got walk and jump working but I cant get the character to rotate by mouse =(

Hey gustavorios2,

It’s difficult to see what you’re trying to achieve with this setup. Are you trying to control 2 pawns in a single player game? If not, please open a new post with your question.

If you are trying to allow one player to control two pawns as this post is about, there are two problems with this setup. First, you’re using the same input multiple times. By default, one of these inputs will override the other. You can fix that by chaining the Add Controller Yaw and Pitch input nodes, or by selecting the Input nodes and disabling Consume Input in the Details pane.

Second, you’re using Get Player Controller at Player Index, which returns the Player Controller for multiple players. If you’re trying to make a single player game, Get Player Controller at Player Index 1 will return NULL. Instead, you should be getting a reference to a separate controller and its pawn for your second input. There are details on this type of setup in the images for the answer below.

Hi ben thanks for the answer.
I’m making a first person single player game. there’s a situation where the character get cloned to solve puzzles. so I was trying to get the input from the player controller 0 to control the clone character too, so they have the same rotation and use the same input to walk and jump.

I got the rotation working using a “Set Actor Rotation” node on a Tick event copying the rotation of the index 0 player.

everything is working fine now =)

Sorry i have been off this project for a while so i just tried your solution but hmm… i cant get it to work,99.999% sure its my fault.
it again just spawns one character that i control with my right stick, nothing els works. help please maybe?

here is what i got so far:

There’s a few things you can check:

  1. Make sure that the Transform for the spawned character is valid, and that it isn’t colliding with anything or spawning somewhere you can’t see.
  2. Your variable names are a bit confusing. It looks like you have it set up correctly, but you’re naming your spawned Controller Rmycharacter and your spawned Character Brothercontroller. I don’t think this is causing the problem, but it will be harder to manage later as your project gets more complex.
  3. Make sure the controller you’re spawning is empty. You’re not actually using it to move the character.
  4. You’re getting the Control Rotation of the Controller rather than the Pawn for the right stick character. Drag off the Get Controlled Pawn and search for Get Control Rotation for the correct node.
  5. For the left stick character, you need to use the variable you’re referencing the character with, in this case Brothercontroller. I’m not sure what NewVar0 is referencing. Replace that with Brothercontroller. You also need to get the Control Rotation from the Brothercontroller rather than from the controller. Reference the solution image I posted above.

Hope that helps!

Oke thank you very much, it took me a while but i got all your tips worked out and fitted in my blueprint. then i got some errors from a constructionscript that i didnt use, something to do with the ''get controlledpawn" spawned 2 characters but only the left one was controlled…
so tried to replace that with a direct reference to the character, got the same error… replaced it with the ‘‘get controlledpawn’’ again to make a new screenshot to share for more help. but then hey error gone, and it works now :smiley:
now its time to make a decent camera setup…
thanks again!

error is still there, but it works so who is complaining :D)

(Editedit: oke forget all i said, it seems it only works if i first, simulate, and then posses… otherwise i just take a camera view half in the ground and i still can only control one character…)

Hey Runehorn,

If the camera view is “half in the ground”, then it’s likely you’re spawning at an invalid transform, or that you’re possessing the wrong thing. Can you post a new screenshot of what your Blueprint looks like? And is this your Character BP or Controller BP?

If you’d like to upload the project to Dropbox and send me a download link, I can take a look.

hay here is a link to my project:

it looks like each time i press play it just spawns 2 cameras, that then disrepair again after i stop the run… and the error from the construction script is in my controller.
Thanks for having a look, you are about the only thing that is keeping my dream alive for now.

In your LMyChacter BP, set Auto Possess to Disabled in the Defaults. What’s happening is you’re auto-possessing the new character as soon as it is spawned without properly un-possessing the default pawn. There’s no reason to auto-possess either of your characters, so if you set both to disabled this should work the way you want.

I’m using ue 4.8.0 and have problem do get it work. I’ve done step by step from this tutorial that seems equal to answer in this problem, but I can only control one character and after few hours trying to fix it I get nothing. Can ayone say what could be wrong?

Tutorial links:
part 1
part 2

Hi hAgi,

I would need to take a look at your project to see how it differs from what I’ve shown in the answer. If you upload it somewhere like Google Drive or Dropbox and give me a download link, I can look into it.

Hi everyone, I’m resurrecting this to let you know I’ve come up with an alternative solution. I’m uploading it now and will edit this post when it’s finished - I’m saying this because I don’t see a “It’s working” post and so I want to help future people if this doesn’t solve their problem.

Solution: CLICK HERE

How would you implement that with animated characters? I am trying to do something like this in a sidescroller template, no luck so far.

Hey Guys,

could it be, that the Solutions and the Video Solution aswell (UE4 tutorial: Control two characters with one player part2 - YouTube), are outdated since 4.8 and 4.9? The People in the Video Comments have the same Problem like me.

First Char moves, but second one doesn’t. There is not much space for erros, specially if you follow all the answers here.

Could someone of the guys, who get it worked, make a copy and update the project to 4.8 or 4.9 and tell us, if its still works?

Greetz Spähling

I don’t believe Add Movement Input is currently working with controllers not controlled by the player, as used in this setup. I have entered a bug report for this (UE-22094) and I’ll post here if I see an update. If I find that this is the new expected behavior, I will attempt to find a different workaround. In the meantime, KitatusStudios has a solution noted above that uses Pawns and a different movement solution that may help.

Thx man, yeah i watched into kitarus solution a while ago. looked pretty complex, but yeah give it a try soon again.

yeah, would be nice if you keep up the information about this. :slight_smile:

Hi, I’ve been investigating this with the provided sample project.

It does look like something in code changed (possibly in 4.8)-- there is a “IsLocalController()” check we use to determine if the CharacterMovementComponent is allowed to apply the input, which has been there forever, but the internals of that function have changed over time. The second player controller is not bound to a “Player”, so it fails this test. I’m looking in to making the code more flexible in this case, so that standalone games don’t check this and consider it a local controller.

Another very simple workaround here is to not use a controller at all for this other Pawn (or at least not possess it if you really need it), and set CharacterMovement “bRunPhysicsWithNoController” to true. This allows movement on the pawn with no controller.