How do you test player 2 inputs in a local 2 Player game?

I got the control over a second character in the scene, but using player 0 ID. The Blueprint content example, Input level helped me figure that out, with the space shooter game.

So right now I have a test going, where I right click and it switches my control to the other character. What I need to figure out now, is if I set that other player to get input from player 1 ID and up, how can I test if it’s working?

Do I need to plug in multiple game pads, or can I test it on on the one keyboard?

Set P1 to move with AWSD, and P2 to move with 4862 on the number pad for example.

Another problem I found when switching characters, was that the special moves I added don’t work anymore. The Punch tutorial Zack made on isn’t working. The movement control and default jump is working though, so I’m confused about that.

Well it took a few hours, but I got the moves fixed that were not coming out. It was due to a casting misdirection in the anim blueprint…

I still don’t see how you test the player 2 controls, or I should say Player index 1, if I need to test both characters at once with controls for P1 and P2 being different.

I got it working now, I have to create a new player and assign that ID to control the other character BP. Then I had to plug in two game pads to play as the other character.

There is a problem with it creating a new window for every player though, it should all be in a single screen.

1 Like

You can use a Set View Target with Blend node and plug 2 Player Controllers into it one for index 0 and one for index 1. Then hook it all up to a camera and Event Begin Play. That will swap your view for both players to one camera on game start. Also your moves not working on both controllers might be because you hooked up a Player Controller node and its point at index 0, so only receiving input from the first controller slot.

I attached some images of how I made my 4 player local co-op prototype. I ended up ditching it, but I learned a lot making it.

I put everything in one character BP, and use the playerNum variable to let each controller use the character and dictate which abilities it could use. I spawn all my players in the level blueprint, but I would probably do it in the Game Mode BP when I was ready to start the game, I use a for loop, and set the playerNum = to the controller Slot basically.

Hope that helps!

I have met the same problem .
I have to playercontroller one control by wasd another one is control by direction key.
I use creat player funtion in my gamemode blueprint.
but seems the second player dosen’t receive any input event.

Any sample project this ? Had read thru the explanation but not really get understood how it work. Many thanks in advance.