Download

Playing two characters at the same time

I need to figure out how to play two characters at the same time!
I’m pretty new to UE and still grappling with all the base building block concepts like the player controllers etc. So sorry if I am saying weird stuff. :slight_smile:

So I want to have a setup with a sort of first person (FPS) character that receives input,
but at the same time a third person style character can also get SOME OF THE input and execute actions.
Sometimes the fps character that the player is playing might trigger actions on the third person character.
Hope that is not too confusing or?

Would anyone have suggestions for how to roughly approach setting something like that up?

Cheers
Fred

Unless there is some special setting I don’t know about, pawns/characters/controllers can only accept direct input while possessed. Notice how I said ‘Direct’ input. This means that you could still easily control 2 pawns/characters/controllers using indirect input. Something you could try is to create an actor, this actor will handle player input for both players. You’d add something like ‘W’ input into the actor, and when it is pressed, you’d call the move forward event on your 1st player, now when the up arrow key is pressed, you call the move forward event on your 2nd player. You can now control both players at once using the input manager actor.

Ok great thanks for the tip!!
I have just tried something that seems to work, please tell me if the following is stupid for any reason:

  1. In my own Player Controller I add a ‘Pawn’ variable for my secondary character.
  2. Also in this player controller I spawn an instance of a blueprint describing my secondary character. I pipe this guy into the variable above (1.)
    now I can execute functions on my secondary by
  3. In the Player Controller I call my action event by taking the above variable, casting it to my character bluprint and piping that into the ‘Target’ pin of the function call from the secondary character.

Now my single action event calls the functions from both characters.

Does that sound ok?

Sounds good, you just need a way to control inputs for both, and if you do that by possessing one controller that controls both, then that works, the only reason I suggested an actor is that it can take input regardless of whether or not it is possessed.

Hey dude, how did you manage to controls 2 characters with 1 input? Would you mind to help me?