Event when all players have loaded map?
Hey, so i have a problem, i have a multiplayer game where all players starts as spectator and then when the match begins the server will spawn a character for all players and then all players will posses their specific character. The problem is that i dont know when to make the game spawn them?
The spawn process happends inside the Game Mode so my first idea was to use PostLogin, but that does not work since i use seamless traveling, everyone "PostLogins" at the Lobby so it never gets called.
I Cant use Game Mode "Event Begin Play" because then only the Server gets a character since he is the only one who is connected at that time.
My solution right now is for the Host to manualy click a Start Match button to spawn all the characters. But that doesnt feel very quality-ish
Is there somehow i can check if all players have loaded the level? If so then i can use that as an event to start.
Help would be appreciated! ^^
Thanks in Advance!
asked Sep 29 '16 at 03:36 PM in Using UE4
I am almost certain you'll have to manage this yourself. My recommendation is that if you know how many players there are going to be in the game (like 5v5), have a integer value that gets incremented by 1 for each on the "OnPostLogin" event. When that integer value is equal to the total number of players the game is expecting, you can have another custom event fire for your "AllPlayersHaveLoaded", or whatever you want to name it.
answered Sep 29 '16 at 03:47 PM
ImVawx ♦♦ STAFF
Inside the GameMode and GameModeBase there is a 'HandleSeamlessTravelPlayer' method, which is called for the player that finished loading, but it's not accessible from blueprints... You can implement 'HandleStartingNewPlayer' event that called inside 'HandleSeamlessTravelPlayer', but this method is also called inside 'PostLogin', so you should determine somehow by yourself these situations if you need it.
answered Jan 13 '19 at 02:10 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here