A project of mine uses a Gamemode class to base logic where enemies spawn in waves, which has an integer variable called CurrentWave.
All players have a HUD that displays the current wave, however, I’ve had difficulties replicating the integer variable from the Gamemode to the client. From what I’ve read, Gamemodes only exist on the server, thus calling RPCS or replicating variables wouldn’t change anything apart from itself.
I’ve tried using a for-loop on the Gamemode per tick to loop through all existing PlayerControllers, then setting another replicated integer variable on that, so it would (hopefully) replicate to the client and could be read by the HUD, but it only just works on the server and not the client.
I am ears open to anyone who can correct me since my understanding on networking is fragile.