Download

BP - Get All Player Controllers From Server's Game Mode

I am running the third person template as the base for a multiplayer project in ue4. Currently, I have the number of players being printed on the server’s screen through the “get num players” block, but I, even though I’m setting an int (expose on spawn, editable, and replicated) each time I print the number, non-server clients won’t pick up on it…

My question: considering that any solution which involves the variable itself just avoids this issue, how can I get all of the player controllers from the server’s main instance?

Gamemode exists only on the server. Your best bet would be getting player array from the gamestate

So how would I do that? (I just switched from Unity so keep in mind I’m a noob) As in, how can I find the gamestate, and what can I use to obtain the player array?

Umm… I found the “game state class” - It is set to none. If I set it to something, will I harm my project?

Fixed that, but now I can’t seem to get the player array in bp. It just doesn’t show up as an option.

Okay, I found that information. Now, the only issue is that when I run it, though the game state is selected, it is only printing the player count on the host’s end, and not for client connections.

Fixed! Thanks for the help!