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:
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.
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.
answered Apr 08 '15 at 09:59 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here