What governs the "player controller"?

Lets say I have 3 gamepads plugged in. And Unreal sees them as Input 00 Input 01 and Input 02.

If I get player controller, I see there is something there called “Player Index” which by default is 0.

Is that what I need to set to assign certain inputs to whatever? If so…where do I set that? And how?

Thanks!

Input is part of the Slate system, which at some point manages things like input and UI. There’s information here:

Prepare, it’s very confusing. Especially when talking about indexes, IDs, it being online or not online, etc. using the words player vs controller etc.

1 Like

It’s been a while since I’ve done local multiplyer, but it used to be pretty straight forward.
You call Create Player Create Player | Unreal Engine Documentation
This assign to the player to the controller in the order they were plugged in, if a specific index isn’t specified.
Inside your ploject settings you can specify in the first controller should be assigned to player 0 or to player 1 (leaving only mouse and keyboard for player 0).

1 Like

quote=“Roy Wierer (Seda145), post:2, topic:1846864, username:Roy_Wierer.Seda145”]
Prepare, it’s very confusing. Especially when talking about indexes, IDs, it being online or not online, etc. using the words player vs controller etc.
[/quote]

I thought I was going to get out of this easy too…:frowning:

Ok thanks for the reply and link, I will check it out.

I just learned of a node today called “create local player”. What do you think is the difference of that and this create player node?

To give you guys a better idea of where I’m at on this. This is for a Beat Em Up style game. When you hit play in UE the first level that loads is the title screen which is just an empty level. There various widgets load. I’m using credits like an arcade game. I have the gamepad left special or select button to insert credits.

Now in this next pic, you will see the input action for select coin. But, how to differentiate the special left or select button for gamepad 00 (player 1) or gamepad 01 (player 2) ??? Any help is appreciated thanks guys.

Input is routed by Slate. When input is received, (the red input node executes), input was already routed for a specific player to the specific thing it controls. That player is controlling his own widgets, his own character, his own controller and so on and input is routed through them in order (see my previous link to Slate). There is no need to differentiate at that point.

When a player is added to the game he should start with a playercontroller but no pawn. Add a pawn for that player when the “InsertCoin” input executes (when you press the player’s input). After a pawn has spawned don’t do it again, just continue with the game.

2 Likes

I think Create Local Player is the renamed version of Create Player. :thinking:
Create Player doesn’t exist anymore apparently.

1 Like