Get a variable by name, using other variables values

If you have the structs in the game mode, for example, you could say → get game mode → get “your struct name” → set members in struct

You would need to either cast to your specific game mode, or use an interface, or you could use Event Dispatches to communicate in a decoupled way.

My preference is to use Events because this seems to offer greatest flexibility and extension. So to make it such that Game Mode doesn’t need to know about some widget or w/e, I use an abstract class (this could be an actor component you attach to the game mode) to handle the events.

Then, widget could say GetGameMode-> Get Component by Class (the event holder) → call event. The event could pass arguments for what data you want to transfer, and what the targets are (where is it coming from, where is it going.)

The game mode can be bound to those events, then based on the where and to targets, you can just direct the data and use Set Members to update the structs.