Game Timer Tutorial for Unity3D displaying Hours,Minutes and Seconds

  Рет қаралды 16,953

Nejo FTW

Nejo FTW

Күн бұрын

A simple game timer, which displays hours, minutes and seconds of elapsed game time. It's something similar to what you would see in some MOBA style games
If you found what you were looking for please leave me a "Like" or even "Subscribe" so you don't miss out on the new content.
The code can be found on my Patreon page:
/ nejoftw
Thanks for Watching!

Пікірлер: 32
@maestradebobobo767
@maestradebobobo767 Жыл бұрын
I've come across many timer tutorials but this is the only one that actually works well, thx
@andreieminovici1894
@andreieminovici1894 3 жыл бұрын
Big help, it works so smothly. That's what I appreciate the most: short and to the point tutorials!
@arnauz11
@arnauz11 Жыл бұрын
what i have to do if i want to save the record of timer? i mean have a timer like tutorial but also have other text with a highscore of time. if you survived 00:01:10 in timer, in highscore will be actualice in 00:01:10
@williampalmeira4654
@williampalmeira4654 6 жыл бұрын
I was breaking my head to make work in hours, your video was a great help. thanks
@CrouContentCreator
@CrouContentCreator Жыл бұрын
can someone help me please,when i try to put my text in the game timer text,for some reason i cant put it in it just dosent go in
@Hiromu656
@Hiromu656 2 жыл бұрын
This was perfect, thanks.
@sikandarchishty
@sikandarchishty 6 жыл бұрын
Hi, nice tutorial. One question thought how can I make reverse timer from this? For Example: Total Time = 2minutes and it should reach 0:00 any help/hint would be great. thanks.
@nsanit7298
@nsanit7298 4 жыл бұрын
@Sikandar Chishty you can just use -= instead of += in totalTime += Time.deltaTime; :D
@umeshdeora4652
@umeshdeora4652 5 жыл бұрын
At 5:00 can you please explain why you write time in {0:0}{1:00}{2:00} instead of {0:0}{0:00}{0:00} ?
@SophisticatedClover
@SophisticatedClover 11 ай бұрын
its just to difference them from each other
@kameramanzaspal9821
@kameramanzaspal9821 6 жыл бұрын
Nice video, thank you for explanation too :) I like when people explain what they are doing there so I can learn it :D
@denkozlov4220
@denkozlov4220 6 жыл бұрын
Awesome vid, it helped me to understand how to create a zero before lone numbers. Gracias!
@The_Big_Rock
@The_Big_Rock 6 жыл бұрын
How would you include days into the script?
@1234yokee
@1234yokee 2 жыл бұрын
Anyone help me please...How to save current time. When game restarted the timer is resume.
@nemoscow
@nemoscow 2 жыл бұрын
public float time; void Start() { if (PlayerPrefs.HasKey("timePl")) { time = PlayerPrefs.GetFloat("timePl"); } timerText.text = timeStart.ToString("hh:mm:ss"); timerTextfinish.text = timeStart.ToString("hh:mm:ss"); }
@peskitsnet
@peskitsnet 7 жыл бұрын
Hi need your help i am making a fighting game but iam stuck. I need to create a round system just like boxing. 3 min 12 rounds can you help please!
@nejoftw4216
@nejoftw4216 7 жыл бұрын
Sure thing, it should be quite straightforward stuff! You probably had a simple countdown timer in mind? It also depends what kind of timer you want, this is kind of an overkill because it's super accurate, for most fighting games it would probably be enough to just do most of your stuff inside some simple coroutines and when the round ends there should be some kind of a short pause between rounds? Maybe I can make a video tonight and upload it if there is enough peace and quiet in the house and ill let you know in the reply
@peskitsnet
@peskitsnet 7 жыл бұрын
That would be great thank you !
@nejoftw4216
@nejoftw4216 7 жыл бұрын
sorry it took a while to actually have the time to upload, I had a deadline with a project and I didnt get to use my home computer much. Link to the timer: kzbin.info/www/bejne/mYW5fJSgl9N0q6s Good luck, make something good
@peskitsnet
@peskitsnet 7 жыл бұрын
Thank you !
@rasan97
@rasan97 4 жыл бұрын
Swift! it works as a charm! Thank you.
@resumosde5minutos694
@resumosde5minutos694 Жыл бұрын
thanks bro!!
@alexandresantos4380
@alexandresantos4380 5 жыл бұрын
Nice tutorial, thanks! Keep nice work!
@spencerhyland5130
@spencerhyland5130 6 жыл бұрын
How would I have the time stop when a certain goal is achieved?
@MrWetwilly69
@MrWetwilly69 6 жыл бұрын
It's pretty simple! 1.) create a new bool variable at the start of the script: bool isFinished = false; or name it whatever you want 2.) inside the update method add an if statement checking if this condition is true, and inside that if statement you should put the rest of the existing timer code. So something like this should do: void Update() { if(!isFinished) { //Put the rest of the timer code here and you should be good to go! } }
@spencerhyland5130
@spencerhyland5130 6 жыл бұрын
Wow I am dumb... thanks haha
@goex4881
@goex4881 4 жыл бұрын
how can i get miliseconds?
@HernanExposito
@HernanExposito 5 жыл бұрын
NEJO THANKS A LOT MAN!
@XRelabs
@XRelabs 3 жыл бұрын
Thank you very much
@TIG_-ud4tc
@TIG_-ud4tc 7 жыл бұрын
thanks boss! timer work in: %60, %24 ?... i found it, i dont know, thanks all!
@random_precision_software
@random_precision_software 4 жыл бұрын
that looks very fast to me lad?!
@egorovsa
@egorovsa 5 жыл бұрын
пасип мэн! то что надо
1 Year of Learning Game Development In 6 Minutes
6:01
Giedzilla
Рет қаралды 2,6 МЛН
PAUSE MENU in Unity
12:13
Brackeys
Рет қаралды 1 МЛН
Caleb Pressley Shows TSA How It’s Done
0:28
Barstool Sports
Рет қаралды 60 МЛН
Working with Time in Unity
9:00
Press Start
Рет қаралды 114 М.
Unity3D Pinball Tutorial part III- The plunger
31:47
Nejo FTW
Рет қаралды 17 М.
I made a full GAME in 400 HOURS - this is how - in 19 minutes!
19:00
Better Jumping in Unity With Four Lines of Code
12:47
Board To Bits Games
Рет қаралды 826 М.
Trigger an Action after some Time (Unity Tutorial)
18:39
Code Monkey
Рет қаралды 62 М.
Path Creator (free unity tool)
10:29
Sebastian Lague
Рет қаралды 416 М.
Unity3D - Scriptable Object Inventory System | Part 1
31:31
How to create a Timer [Tutorial][C#] - Unity 3d
7:41
N3K EN
Рет қаралды 191 М.
Every 2D Node Explained in 9 Minutes !
9:19
Lukky
Рет қаралды 394 М.