This is a seemingly easy problem that I am stuck on. I have an event post login in my game mode that spawns a new player when they login. After this happens, I would like every client that is logged in to update how many players are now in the game. I first tried to do this with a multicast event in the character blueprint that got the length of the array from “all players of actor class” and stored it into a variable. However, when I tried to access this variable on the client, it’s value was 0.
Any help is appreciated and thanks!
In your game state, on the server, have a value that gets incremented when the player logs in, and decremented when the player logs off. Replicate the value and voila.
Sorry had game mode before, I should say game state. The game mode only exists on the server, where the game state exists on all clients. If need be, simply have a replicated integer on the game state, which is accessed from the game mode when players connect/disconnect.