Local 1/2/3/4P on same screen with different character with playerstart on multiple gamepads

Hi, excuse me for this newbee question but this make me crazy, I already tried many many hours with no result.

At this moment I would to make it working with my 2 gamepads, the 2 gamepads work perfectly. I succeed to make the 2 working one moment but without control (using a part of the automatic system).

Now I would to succeed to spawn the character of my choice at the different player start to make after a 4 player game. So I would to use a loop.

Every time my best is 2 players are spawn on the 2 player start but one player is controled :frowning:

They must be something wrong please tell me

the blue print of the caracter class and my Game mode, The code give me no errors.


2 Likes

I think I have to add only one time the mapping context in the parent class of the character but how can I know wich player controler to add because it’s do on the constuction moment not ? :confused:

2 Likes

You might want to look at the overridable functions inside your game mode, especially ChoosePlayerStart and GetDefaultPawnClassForController

This looks like a better place to do what you want to do.

CleanShot 2024-04-25 at 10.45.36@2x

Mapping context can be set inside each controller class.
And make sure your pawn/characrer don’t have Auto Possess enabled in their class default.

1 Like

Thank you a lot to help me, I will investigate what you tell me. I redo my 2 BP and thinked that better but the second player do not react to the gamepads :frowning: No errors at compilation too
The autoposses was disabled.
I don’t have the choose player start (I’m with the UE 5.3.2) :frowning:




The two functions I’ve mentionned are Overridable functions.
Look at the FUNCTIONS category on the left, it’s written 33 overridable), hover on the category and you should see a button to override the functions I’ve mentioned.

Overriding means that those two functions have a default implementation already defined in code, but you can make your own and override the default implementation.

Thank you ! I found it now ! :slight_smile: but I really don’t understand how to use it. I would say that I would first succeed to make my second gamepad working because at the moment my 2 pawn are spawning at the right place but only one is responding to the game pad. Do you see a problems on my 2 last blue print ?

Not right away, you might want to test with three player and check if one of them isn’t assigned to the keyboard.

Also, be aware that one controller will be spawned by default. So for your first controller you don’t need to call Create Local Player. You should give a character to possess to the Player Controller 0, and then Spawn Player Controller 1 and give it its character.
Your prints should be telling you that you are spawning Player Controller 1 and 2, since Player controller 0 already exist and is spawned by default.

I will investigate in this way thank you.
here is the result of the prints if perhaps it’s sound more for you
result

Edit :slight_smile:
I plugged a third gamepads and add a third startplayer and the 3 work with gamepad !!

So the quastion to resolve is why the first not respond to the first gamepad :confused:

A big thanks because I endly advance ^^

result2

Yes that was the problem !!! the first was created by default.
I post the correct GameMode so it can help other newbies as me :slight_smile:

A big thanks to you Sly.SK !!!

You’re welcome :slight_smile:

1 Like