- Home /
Creating a Timer? Halp.
The current code I've been using was given to me by a previous help thread that another member posted when looking up how to do some Timers in Unity
Time.time + attackTimer;
This is a Timer, but... It uses the amount of time that the game has been going to itself, and then adds one. That's not what I wanted.
I'm trying to find out how to make a timer that goes on by One Second ticks, so I can time things the way I want them to be timed, this however is not working. I don't want it to go by the gameTime, because if the Timer stops, attackTimer stays the same, so if I'm to walk away and come back, there's no timer required because the value was already passed during my time doing other things.
Answer by Tocaro · Jan 19, 2013 at 08:57 AM
Thank you, may I ask you this?
String, time : float, repeatRate : float
When initializing the repeatRate, since this is a combat system, I don't want it to puase at all.. So to make it continuously repeat would I make that 0.00? or 0.01 for the $$anonymous$$imal pause, or what?
Well if you don't want it to pause at all, then it's not really a timer. If you want something that's constantly called just put it in the Update function.
Your answer
![](https://koobas.hobune.stream/wayback/20220613091210im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
A node in a childnode? 1 Answer
How would you make your player freeze for a certain amount of time? 2 Answers
How to call a routine every 3 seconds? 2 Answers
Time based scoring 2 Answers
Pause Time.time? 1 Answer