Does Choose Player Start Function let you choose specific player?

Hello guys, I’ve been working on this split- screen game requiring player 1 to spawn here and player 2 spawning there. It would be ideal to select the player start actor from the level editor and assign it a player id through the details panel, but we don’t have that. The web says choose player start but it spawns player 2 on top of player 1. I’ve tried many ways to specify the player to no avail. Can someone demonstrate how the logic works on choosing the player for whom we are choosing a player start for?

Welcome @SaccredKenji

I think your best choice here would be going with your own custom class that would act as player spawn. You would place them in the level, just like a regular player start. These can have some variables (like Player Index/ID, already used, etc) so you could decide on which of your player starts would apply to which player.
When player (controller) is created, you could make a call to game mode or game state (where array would live) and your where to spawn (or move) each player.

Maybe that will help. :person_shrugging:

It is not “choosing the player to for whom…”. This function is automatically called for each player and that player is passed as a parameter.

Setting it up like this:

Will give a new starting position from the array of starting positions. From this point is just a matter of initializing the values like so:

If you have something more specific in mind you can actually access each player. Similarly of how I get their name, you can cast each player to your custom class and access your custom data like team or name to help you decide which start position to return.

I hope this helps you.

Happy coding :wink:

Sorry of the late reply. I will try the BP you got there tomorrow due to my hours. I’m assuming the debug section on your function is not necessary? I’ve only been coding for a bit over 2 months so I’m still trying to understand the lingo. Going custom class actor for spawns might be the way assuming I don’t have to recode the gamepad controls.

Yes, the debug part is not necessary.

You don’t really need a custom class. What I meant to say is Choose Player Start receives a Controller and you will have to cast it to the proper class to get specific info like this.

In this case you’ll have to figure out how to set the proper Start Location 1 and Start location 2.

If they are always the same and already placed in your level, this is the perfect candidate for the level blueprint (since they highly depend on the already placed starts):

If you want something more generic that works with any level go with the first set of BPs but have less control on the order of the spawn locations.