I have my score calculations in the GameMode. And I want to update the UI of all the players with the current score. But I can’t figure out how to get a list of all the player controllers, to call a function/event on them, which would be passed to their UI widget with the updated score. The score calculation is behind HasAuthority() so that clients can’t cheat, so even if I had all the PlayerControllers would a function call end up being an RPC?
What is the correct way to do an event based update from the GameMode/GameState/Level down to the UI attached to a PlayerController?
I’m trying to avoid polling the GameMode in the UI’s Tick() to fetch the score, and instead only updating the text when the score changes. Because lots of things using Tick() will slow your game down, and I’ve noticed that setting text is rather expensive because it calculates the width of all the characters etc…