How can I update a text object dynamically in the Blender Game Engine? I have seen examples of HUD's showing a dynamic count of either ammunition or objects. I have the general idea of what I want, but I need to know how to update a text object dynamically in the game engine. My use case would be like so: on [collide with collectible] update[stockpile = stockpile + 1]. 

Basically, I want to add one to a value (dynamically displayed in a text element) every time the player collides with a certain type of mesh.
you can do this using logic bricks, the following are added to the text object :



the Text object has a special property called text, i have added an integer property which is incremented by space key then it gets copied to the text property at each logic tick

here is the test play :