Hi
I've been trying to add a hunger mechanic to the game. The idea is that a math:add, node, connected to a progress bar, adds 1 to a running total every x seconds. When the count reaches 100, the player is slowly damaged, until they eat 'food'- usable basic entities scattered across the map. Using one will cause it to disappear, and will subtract a certain amount from the running total.
I can't get it to work, however- look at the screenshot below. When I use the entity, I used the setnumber node to specify how much to subtract from the running total. The problem is that using the entity doesn't trigger the subtract sum- it just loops over and over as soon as I ctrl+g. Since it is taking away from 0, this causes a negative value, making the progress bar disappear.
Can anyone work out how to make using an entity trigger the math:sub node?