Total items and items collected problem.

Hi guys,
I have a character who runs and collects items on his way and I have set it so whenever you press play again/Start game, the items collected reset to zero BUT the items collected should be added to the total items in the market. And my market is in a completely different scene which you can access through the title screen or game over screen, and I have set it to when you click on market, pause game and it opens the market.

Now the problem I am facing is that after collecting some items and then when I go to the market after losing, the total items is fine but when I close the market and reopen it, it doubles the value to as many items I collected in game, and keeps adding whenever I close and reopen it.

My attribute is saved as this in the Display text actor of total items like this - Total_items = Total_items+Items_Collected

Now my best guess was that whenever I am changing the scene/pausing the game, the total items in adding up to the items collected but I don't exactly know how to prevent it when I am not collecting the items. I tried searching the forums but all I could find was how to set up a shop, which I already know.

Sign In or Register to comment.