- Home /
Question by
KitingMechanics · Oct 15, 2020 at 10:36 AM ·
timerprecisioncooldown
Very Very Precise Timer ?
How can a I make a very precise Timer? Right now I use This:
void Update()
{
if (timer > 0f)
{
timer -= Time.deltaTime;
}
//Yup its reloaded
if (timer <= 0f && reloaded == false)
{
reloaded = true;
reload.value = reloaded;
timer = 0;
}
}
I use it to track the cooldown between attacks. It varies by 0.01f to 0.05f and I can feel it when attacking. How can I get something precise and efficient ? Coroutines? InvokeRepeating? StopWatch? That's all I heard can't decide what suits best to track cooldowns. How do games like dota or league do it? Cheers
Comment
Your answer
Follow this Question
Related Questions
Free 2d dash ability script! 2 Answers
Making a boost for a spaceship with cooldown. 1 Answer
Cooldown/Timer system (Javascript) 0 Answers
Laser fire time limit 0 Answers
.js Timer to prevent chatflood? 1 Answer