I have two scripts, a singleton, global static MainManager and and a custom Button script. For whatever reason, as soon it starts counting down with time.deltatime, it jumps immediately to zero… I don’t understand why… it works if I multiply Time.deltaTime with something like .02f but it seems like a rather odd behaviour to me.
Mainmanager has public float cooldown = 2
the button script has this:
I see the number in my inspector and no, I’m not good at debugging… but I sort of found the issue. I have multiple custom buttons with this script attached and then I click on all buttons at the same time, the timer starts to accelerate, which is the reason why multiplying by 0.2f works and why it jumps directly to zero, now I have to find a way to stop the timer from accelerating.
Don’t manage a cooldown in one class from some other class, let it manage itself. Or at the very least call a function so you can track down these issues more easily.