Just getting started with C++ and doing some tutorials so bear with me…
I’m trying to create a scoring system for a simple game. I created a GameInstance to keep a score value and to hold the functions GetScore and IncrementScore.
I also have a UserWidget class called ScoreWidget that has a TextBlock that displays the score. Then in my BP_GameModeBase I’m creating a BP_ScoreWidget that is a child of ScoreWidget.
So in order to update the score on screen, I want the GameInstance.IncrementScore to tell the ScoreWidget to update its text field (has a function call that accesses the GameInstance).
My problem/question is how do I access the ScoreWidget from the GameInstance?
And as a bonus question - is this a sensible way of doing things?