Switching between two pawn

hello

I have a problem because of my lack of knowledge about “player index, controller id, possess,player controller,”
I put two player start in the scene, I set their player start tag each,"0"and “1”.
To set which player appear upper screen,or down, I overrided “choose player start” in Game mode BP.

and
here I could let two pawn to be spawned,

but I am wondering how I can switch to play downer screen player.
here is the level BP. Im trying to possess second spawned player. But I can possess only first one.
sorry im really know few about systems around player.

I wish someone give me advice for this.

ChoosePlayerStart gives you a Player reference.

This is a controller that you can Cast to PlayerController.

Then you can call GetPlayerControllerID. This will return an integer number.


0 = First Player

1 = Second Player

Use these numbers to return the appropriate PlayerStart.

Note that this method can only be used in local multiplayer games

Thank you very much GarnerP57
I will follow your advice and I will post the result as soon as possible.
It seems I need cast to playercontroller from “ chooseplayerstart” in GamemodeBP.

sorry for my ignorance, but “PlayerControllerID” and “players index” are totally different things?

Yes

PlayerControllerID is whatever ID you give that player and it will not change unless if you change it.

PlayerIndex is a list of the remaining players.

If you have 2 players and the first player left then the second player PlayerControllerID will still be 1 but its PlayerIndex will now be 0.

I could solve by “set player controller id”
I used the node at level BP as connecting to create player.

But I could not do with choose player start.
I connected player reference from “choose player start” to cast “player controller” and “set player controller” as 0 in branch of judging player start tag.
But I could not get expected result.
Here is the GameMode BP I overrided “choose player start”.
I wish if I could get an advise.

This way you can select a named PlayerStart Actor.

Find PlayerStart for player one in your map and enter 0 in the Details Panel at the Property Player Start Tag and 1 for player two

Notice that when you call CreatePlayer you can leave the index at -1 as it will automatically pick the next available number.

Remember to delete your existing Choose Player Start Function and any other overrides you may have added to the GameMode first.

thank you very much GarnerP57
It seems there are lot of rules and nodes, It is impressive to know that node does not need plug such as “Get Num Players” in your suggestion. In my version I could not put “Get Player Controller ID” as pure function node.
but thank you for the advice.

Get Num Players does need to be plugged into something I just left those nodes in the same screenshot. You should make an event somewhere and call Get Num Players etc.

Start by dragging from the New Player before searching for Get Player Controller ID or it won’t show up.