Local Multiplayer Setup Help

Hi all,

I am working on a local multiplayer game and can’t get the pawns to be possessed by the player controllers correctly. Currently, I have 2 player starts in my map. I am looking for the player starts in my GameMode blueprint. Once I find them, I do a For Each loop and spawn a player character and possess it. My Player and Player Controller blueprints are pretty minimal. In the Player Controller, I have input on the X and Y axis. In my Player blueprint, I set the team color and set the “PlayerCast” variable in the player controller.

When I start the game, the two players spawn correctly and are on the correct teams, but I can only move one of the players (I have two gamepads plugged in and have been testing both).

Here are the screens of my blueprints. Any idea why it only moves one player? If I’m going about this all wrong, could someone give guidance on a better way to set it up?

Thanks!

&stc=1

&stc=1

&stc=1

&stc=1

Well you dont seem to be possesing the pawns properly. The loop is assigning “player index 0” to each pawn. You should be incrementing that with each loop the way I see it.

Also, are you replicating properly? If the two screens are shpwing 2 different things then its definitely a replication problem.

Does he even need replication? The text and title talks about LOCAL multiplayer.
Sadly i haven’t looked into local multiplayer yet. I remember that there is a node called “Create Player” or something like that, which creates you a new LOCAL PlayerController.

Maybe you can fiddle around with that (:

@eXi - oh my bad! I understood it as local area network, not local as in 1 machine xD

@6ixpool, This is for local multiplayer on one machine. I might decide to try multiplayer with replication later on but for now I would like to get this working locally. I have tried incrementing the player index for the “Get Player Controller” but when I do that, I am unable to control any pawns.

@eXi, I have tried using the create player node but it doesn’t even spawn a player. I’m unsure why.

“CreatePlayer” takes an INT for the Controller ID that should be spawned (1 for example). It also has a boolean to control if it should spawn a Pawn
and (i guess) possess it. The return Value is the newly created Controller.

I guess for the Pawn to spawn, you need to specify a Default Pawn in the GameMode. If you spawn the Pawn by hand and left the Default Pawn empty,
you need to spawn the Pawn by hand here too.

Unfortunately the Controller ID for “CreatePlayer” has to be unique. Otherwise it won’t spawn a new player. So that might be your problem with that node.