Best way to handle local multiplayer with Blueprints

Hello, I am new to Unreal Engine coming from Unity, and am having some difficulty understanding and implementing the whole Player Controller / Pawn setup.

Say I want to have 4 local players on my PC, each with an xbox controller, controlling 1 character each (shared top down camera).

My understanding is that I would need to do the following:

  • create a Pawn blueprint which has the
    model etc as components, and
    behaviours (e.g. move forward, shoot
    etc)
  • create a PlayerController blueprint
    which handles input
  • drag 4 Pawns into the scene
  • drag 4 PlayerControllers into the scene
  • set each PlayerController instance to take input from a different player index
  • get each PlayerController to possess a pawn

Alternatively I could make the PlayerControllers spawn and possess pawns when the game begins, I am unaware of the pros/cons of either approach though.

If this is correct, can someone please provide a blueprint example of how to route the input received in the player controller to the behaviours defined in a possessed pawn (or at least point me in the right direction)? Otherwise I would love to hear what I’m doing wrong and hear an alternative solution.

Cheers :slight_smile:

I’d like some information on this as well, as I’m trying to create a small local multiplayer. I’m having trouble attaching HUD’s properly and attaching the appropriate pawns on spawn.

To anyone else struggling to get started with this kind of thing, basically you need to understand that

PlayerController represents one of your players
Pawn is an entity controlled by a player.

PlayerController should handle input via the input axis and pass it to the controlled pawn, who will decide what to do with it, so for example the player inputs ‘shoot’, so PlayerController listens to that event and calls the ‘fire gun’ function on the controlled pawn you have made.

Lastly to add more local players into your game all you need to do is use the console command DebugCreatePlayer -1

To add a player manually just use the Create Player node in BP.