How do I control a second player with a gamepad?

I’m working on a two player game in which one player uses the keyboard+mouse and another uses gamepad. I’m having difficulty understanding how to make the second player move using the gamepad. I did some research and found that I need to “possess” the controller for the second player in the game but, I am having trouble understanding how to do this. This is the blueprint I have set up already.

Hi Chimps,

In your Player Controller for your second player, create a “Possess” node, and select your Player 2 blueprint. That should do what you are looking for.

Is that done in the construction script for the character? Something like this?
Thanks for responding, .

I would actually do it with an event begin play in the event graph. The Construction Script is typically used for changes that occur outside of real time. So things such as changing the location of an object in editor or anything that must occur before an object is actually present in the game.

I tried possessing the character but it still isn’t responding to the input I give it. Should I be using the “Create Player” function as well?

When you are using the gamepad, are you able to move the first player around or do neither the first nor second player move when you utilize the gamepad?

It’s just the player controlled by the gamepad. I have tried 3 different gamepads.

Hi Chimps,

Ok I have two more questions:

  1. Are you doing a local multiplayer splitscreen or shared screen?
  2. Have you tried setting a branch in front of your inputs to test whether or not it is player 0 or player 1? If you set this up this way, what you can do is set up to prevent any action from occurring if they are not the right player controller.

I am doing local multiplayer where two players share the same screen.

I have not tried this. Is there a specific function I can call to check for their player number/index(I’m not sure if they are the same thing)?

I’m sorry about the late reply, I’ve been busy with the holiday.

Hi Chimps,

What you can do is promote the player controller to a new variable and do a == (int) check to see if that variable == 0 or 1.

I am essentially building off the third person blueprint project, so I don’t have a separate blueprint that has my controls. Would you recommend that I use a separate blueprint to control the characters?

You shouldn’t have to, you can simply add the branching if check before the input commands. The player controller check can be called from both the player controller and the player pawn/character without any trouble so it shouldn’t make a significant difference which you are using.

Hello guys, Did you find a solution for this? I am trying to do the same thing but no luck so far! Also, I don’t know how did manage to ref self to InPawn in Possess? I tried but it won’t let me

Many thanks

Try this, i dont have multiple gamepads, so no chance to try it out…

No luck so far. i am stuck with this too.

DON’T WORRY
SUPERMAN HAS ARRIVED ALRIGHT LADYS AND GENTS. Its actually very simple under the local multiplayer tab theres an option called SKIP ASSIGNING GAMEPAD TO PLAYER ONE. to get there simply click edit then project settings and search the option or local multiplayer,
hopes this helps,
PS
LOCAL MULTIPLAYER RULES!!!

Its actually very simple under the local multiplayer tab theres an option called SKIP ASSIGNING GAMEPAD TO PLAYER ONE. to get there simply click edit then project settings and search the option or local multiplayer, hopes this helps, PS LOCAL MULTIPLAYER RULES!!!