multiple timers

I am integrating a countdown timer with another timer which also counts down. This other timer also counts down, however is based on points. For instance, the player could gain points (through a treasure hunt) however the timer depletes the number of points continuously (the player is constantly in a mode of replenishment). The idea is to have the player grab the items that will replenish quicker than the timer depletes his/her points.

Any ideas on whether or not I need multiple timers would be useful. Thanks!

If you're tracking two separate things, then you'll need two separate variables (or "timers").

As I understand it, you're tracking both:

  • Time
  • Points

Time will count downwards by subtracting `Time.deltaTime` every frame.

Points will also count downwards, but you'll probably need to apply a multiplier to the countdown amount, otherwise it'll count down at the same speed as the time. When you pick up items, a specified value will be added to the points "timer" (variable).

You need these as separate variables, otherwise when you add value to the points timer, the time remaining will also count down.

Try writing the code for this on your own, and post a question (with the code included) if you get stuck.