You could do a couple of things, in my example above, I made the variable inside of the actor and had it increment there; however, If you wanted the value to update on a widget I would do the following:
- Create your variable inside of your game state and create your widget there (Screenshot_01)
- Your widget should have a variable that is bound to your text (Screenshot_02)
- Now we simply cast to the game state upon click the sphere and update the values (Screenshot_03)
Hope this helps!