Come Learn Blueprint Multiplayer with me! (aka 's a Glutton for Punishment)

I think I have a working solution for problem #1!

Using the knowledge that the Gametype was chosing the playerstart for the pawns in ShooterGame, I tried to access the functions being used in C++. No luck. I did however discover that I cannot use the variable names defined in GameType.h (specifically the PlayerStarts array!) But I could use the function names. While it’s probably a bad idea, I’ve done it anyways :stuck_out_tongue:

**Here’s how it works. **
When each player logs in, they spawn a pawn. In the Construction Script, I have the BP_MP_Pawn ask the BP_MP_Game GameType to find a PlayerStart actor in the level whose PlayerStartTag variable isn’t set to ‘Taken’ (the only variable accessible for PlayerStarts though Blueprints, and seems to be replicated.*).

This is accomplished by casting the gametype to BP_MP_Game and running the ChoosePlayerStart function. This function iterates through the PlayerStart actors in the level and compares the value of PlayerStartTag to ‘Taken’. If it’s not, it breaks the loop, then sets the tag to ‘Taken’ (so it will skip over it next time), then returns the PlayerStart actor reference to the Pawn that called the function! The Pawn simply takes that data and sets its location and rotation to match the PlayerStart.

Choose Player Start function (in BP_MP_Game Blueprint)


BP_MP_Pawn Construction Script


Here’s proof it worked!


Them pawns be lookin’ at eachother!

**Next up: **
Movin’ dem Pawns! Stay Tuned!

*I could create my own brand of PlayerStart actors using blueprints, as there isn’t anything particularly special about the class for this examples particular needs, but that’s over complicating things… for now…