Download

CreatePlayer not "granting" control / multiplayer control issue

I am creating 2 players to control 2 characters in my level blueprint. The characters are spawned but I do not have control over any of them. What I am trying to achieve is to have the gamepad control one character, and the keyboard the other.

I am attaching what I have in my level blueprint. NOte: this is after a lot of tries and in the meantime I managed to mess up my fixed/ static camera as well, but that is not my main issue here.

createplayer.png

This is assuming you havn’t touched any of the C++ code.

I think you’re actually ending up with 3 players in the game there, player 1 spawns the GameMode’s default pawn automatically on the game start and the keyboard/controller 1 will be automatically assigned to that pawn. The create player node will add another controller and pawn so you’ve added two more players and then assigned player 1’s camera to look at player 2’s pawn, and player 2’s camera to look at player 3’s pawn. Player 1 is maybe off screen responding to your controls wherever it’s spawned, or if it’s set to the default pawn out of the box you probably can’t even see it as it’s just a first person camera with no visible mesh :slight_smile:

You could try plugging in 2 game controllers if you have them, you should see if I’m right that controller 2 controls what you think is player 1 (it’s actually player 2)

You could try using a ‘print to screen’ node to show how many players are currently in the game. I can’t remember off the top of my head if it’s in gamemode or gameinstance. Maybe add another output on your sequencer node so it runs after all your existing code, use a ‘get gamemode’ node and then from that node you can get the ‘get number of players’ node. Print this to the screen and it will tell you how many players you’ve currently got. I reckon it’s going to say 3.

To fix it I reckon you remove the ‘create player’ node from the first sequence, just spawn the character pawn and then possess it with controller 0. That should then be player 1 assigned to that pawn you’ve just created. You should be able to leave the other create player sequence as it is as that will spawn player 2 and possess the pawn to player 2.

Another way to check it, in the editor settings you can set multiplayer to be ‘split screen’, tick that and then run your game. If 3 viewports appear then you’ve got 3 players :slight_smile:

I could of course be totally wrong but worth eliminating this possibility.