Download

Multiplayer Shootout blueprints

I’m trying to figure out how multiplayer works and the multiplayer shootout project was a perfect place to start. I have a question about how the players are spawned in. I want to change the randomness to static locations but looking at the blueprints I can’t figure out what I need to change to remove the random spawning. I feel like it’s simpler than what I’m making of it.
shootout.jpg

It’s actually not random.

The Event OnPostLogin runs first and will have the server get all of the Player Start actors in the level. Each Player Start has a Player Start Tag which detects if it is the Player 1 start. If so then the Player 1 variable, which is an array of PlayerStarts, has that PlayerStart actor added to it, if not the PlayerStart is added to the Player 2 PlayerStart array variable. It will then set the current number of players in the game to Player Number and then call Client Post Login on the client that initiated the OnPostLogin event.

I believe the ClientPostLogin event in the PlayerController creates the UI for the passed in Player Controller and then will call the RespawnPlayerEvent.

The RespawnPlayerEvent first checks if the client has a controlled pawn. If this is true it will destroy the current pawn. If not true, it will grab the passed in Player Controllers Player id and compare it to the Player id of the first player in the Game State’s player array. If true, this means the Player Controller is for Player 1 and will spawn the actor and place it at the Player 1 Player Start transform. Otherwise it will place the actor at the Player 2 Player Start transform. It will then tell the player controller to possess this new pawn.

Essentially, if Player 1 joins (the host), it will place them in the Player 1 Player Start location, otherwise it is Player 2 (the joined client) and it will place them at the Player 2 player start location.

Thanks. Sometimes it just helps to have someone break it down for you. I think I know what I’m missing now.