Getting a Counter for each click of an object

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:

  1. Create your variable inside of your game state and create your widget there (Screenshot_01)
  2. Your widget should have a variable that is bound to your text (Screenshot_02)
  3. Now we simply cast to the game state upon click the sphere and update the values (Screenshot_03)

Hope this helps!