Multiplayer spawn points blueprint

Hello all! I have a question regarding multiplayer spawning, and before I go into that question in detail I am relatively new to UE4 and scripting in general, so bear with me. My question is, is that in a multiplayer game using blueprints how do you make the player spawn on a different spawn point than the other “teams” spawn? I know there is a C++ way to do this, but I need a way to do it in blueprints.
Thanks in advance!

First create PlayerStart class which you will extend with new variable, called Team, it could be integer with team number (0 could be any team ;]) or enum, you can also create team class or something.

Place your (not default from engine) PlayerStart on level and in detales tab you should able to edit team varable, using it you can set PlayerStart to be set to specific team

In your GameMode on begin play search for all PlayerStarts and put them in array for all teams each (so you got 2 teams you got 2 arrays), depending on there Team varable state (in case of integer, if its 1 put it in first array if 2 then i 2nd array)

Now override (cover over function you will have override menu) FindPlayerStart. This function is called when player is about to spawn and spawn system asks you which PlayerStart to use and it will give you PlayerController of player that is about to be spawned. Based on that assign proper PlayerStart from specific array, by checking in PlayerController is assign to specific team (so in PlayerController you also will need ot ■■■ Team varable).

If you know C++ solution, try to recreate it in blueprints, blueprints use same APIs, it maybe has limited access to it but you can do lot of stuff with it.

There many ways you can go with it, i just give my example, but try thinking for yourself, there will be amny other system to made so you need to develop logical thinking on figuring out to make those systems, or else you end up always asking how to do things

2 Likes

Thank you! I have modified your answer to fit more of what my game needs, but this helped!

Great post by , I added a bool instead of an int and a collision sphere to know if anything surrounding it was taking up the spawn point (good for enemies).
Then in the override of the function I got all actors of class - Spawn point, then got the bool and built a new array with the ones who have ‘Repsawn taken’ set to false, then get a random spawn point from the array and voila!

Nice! Sounds like a well implemented multiplayer system, prevents spawn camping too!

Care to show us an example in blueprints of how to do this?

My team is having troubles making players only spawn at their own spawn after the first few games. The first few games it works fine, but then for some reason after a certain amount of games played (I think it starts bugging out on the 3rd game) it starts spawning players into the enemy base

Hi my solution is very similar but I also want to spawn my Player Start actors at the beginning of the game. I spawned them in EventBeginPlay but somehow it doesn’t work. Is there any event that fired before EventBeginPlay? Or how can I delay player spawns?

I have tried your solution and it doesnt worked. I dont know what I am actually doing wrong. If I override the FindPlayerStart method I get the error Couldn't spawn player: Failed to find PlayerStart what I have done: Creating an array of controllers which gets filled at BeginPlay and just choose the first one out of the array within the FindPlayerStart function override. But the FindPlayerStart gets called before the GameMode BeginPlay function -.-"

BeginPlay can be too early, make list on the go, when player join or leaves, there events for that in GameMode

Thanks for your reply, I have work around it now by overriding ChoosePlayerStart and in it: if the playerstarts array is empty get all playerstarts and pick one of them else just pick one.

It would be amazing if we could get an update of this. I am trying to build on the Unreal Engine Multiplayer tutorial which is on Youtube but with no success. I am driving myself nuts trying to get this to work. Here is the link to the project file, if anyone would be so kind to take a look at it, especially the OP.

Google Drive Link: