can we say timeStart = -Time.deltaTime; why cant this work ?
@Tomatexyz2 жыл бұрын
@@NeedforSpeedMostWanted-yk4gz -=
@VasilyGurzhiy5 жыл бұрын
best explanation, I've found on yt, thank you for the tut!)
@pressstart68645 жыл бұрын
Thank you for your kind words :)
@VasilyGurzhiy5 жыл бұрын
@@pressstart6864 totaly worth the job you've done!)
@VisserStudio5 жыл бұрын
Works like a charm. Out of all the tutorials I've watched this is the first one where I see the ? and : being used.
@encounter85 жыл бұрын
Wow...I think your Unity tutorial should be listed as a course on Unity Learn. Your videos are just way more easier to follow through and practical. Thanks a lot for AWESOME tutorials!!
@Clavertus5 жыл бұрын
What a great video, I don't understand why you don't have more views and likes :D Good job mate, simple and to the point
@pressstart68645 жыл бұрын
Thank you! We're new but we're growing slowly.
@gralegath2 жыл бұрын
Simple and to the point. Exactly what I needed to have my day night cycle script run automatically, granted I'll need to modify the code here a tiny bit, but that's easy. Thank you so much.
@yahyashafqat73524 жыл бұрын
Man why haven't I posted in 10 months Your tutorials were ans are great and have helped me improve a lot so it will be helpful if u posted again
@СтешаВласова-г5й Жыл бұрын
I LOVE YOU BRO, YOU MADE MY DAY
@stavi9753 жыл бұрын
good tutorial! Without you i couldn't figure out how to work with time, good explanation also!
@imvincible13914 жыл бұрын
If you wan't to make the countdown timer go up just switch, (Great vid!) timeStart -= Time.deltaTime; to timeStart += Time.deltaTime;
@NeedforSpeedMostWanted-yk4gz4 жыл бұрын
can we say timeStart = -Time.deltaTime; why cant this work ?
@oddept2 жыл бұрын
@@NeedforSpeedMostWanted-yk4gz Hey a year late. "timeStart -= TIme.deltaTime;" actually says "timeStart = timeStart - Time.deltaTime;" So it's removing it from the variable. "timeStart = -Time.deltaTime" is setting it to deltaTime, so not removing it. Don't know if you still needed this but incase someone else strolls onto this video and wonders why.
@troys14263 жыл бұрын
That was rly intuitive solution ngl
@miliuskairys65953 жыл бұрын
Thank you soo much. A very simple and effective tutorial
@IamHappyHi5 жыл бұрын
Exactly what I need! Great job! Thank you soooooooooooo much :)
@jort95464 жыл бұрын
Excellent video! You're great at explaining things.
@stickystick55694 жыл бұрын
Simple and Very informative. Thank you!
@PaperMickaelle3 жыл бұрын
Thanks for the tutorial! Still a beginner and this helped me a lot. :-)
@borahaemypreciousbts79724 жыл бұрын
Thank you so much! Clear expanation! Great video!
@sheepFactory3 жыл бұрын
Love you brother thank you so much for this.
@manuelfont44945 жыл бұрын
Thank you very much for this tutorial
@justsomeclips_3 жыл бұрын
hey man thank you! Got a really good tip from your video :)
@lavycube35214 жыл бұрын
Thank you for a great video, exactly what I was looking for👍
@Wendell-om3nq4 жыл бұрын
AMAZING, idn what is better the explanation or all the shortcut syntax code that I've just learned!
@tanasedaniel544 жыл бұрын
How can I change the format to minute?
@AbdulRahman-vt4bw4 жыл бұрын
Thanks a lot this tutorial is very helpful. :))
@razvand7844 жыл бұрын
Thanks!You help me a lot!
@sdisag98895 жыл бұрын
Is there a way to do the stopwatch in the format of 00:00 or 00.00? Keeping it as seconds and milliseconds?
For milliseconds do: milliseconds = (int)(timeStart * 1000f) % 1000;
@sdisag98895 жыл бұрын
@@pressstart6864 Figured it out. Thank you so much!!
@pressstart68645 жыл бұрын
@@sdisag9889 Great!
@_dowool_4 жыл бұрын
is there a way to add Reset function to the code? I am very new to coding and am struggling.. Please help!
@NeuroDeveloper4 жыл бұрын
I really like how you speak.
@nibor91834 жыл бұрын
Tnx dude, you helpt me a LOT
@CubeMasterLewis4 жыл бұрын
Very helpful. Thank you
@red_app14184 жыл бұрын
great tutorial thank you!
@jennawrightson244 жыл бұрын
thank you for the tutorial ..
@joelcollegework1914 жыл бұрын
Do you know how to make it so the timer does not reset upon changing a scene? Great tutorial!!
@domedin98943 жыл бұрын
try storing the date in a variable
@CJRH1FILMS4 жыл бұрын
Excellent Tutorial. +1 Subscription
@drtrouser2 жыл бұрын
So good!!
@alrexomandam17744 жыл бұрын
how do I make a gameobject appear after a certain time is passed? For example the StopWatch just reached 30s and then I want my boss to appear when that specific time is reached?
@RTDTim Жыл бұрын
THANK YOU GUY!
@PurpleLion12144 жыл бұрын
What code can i add if i want something to happen when the timer reaches 0?
@infernojoe4 жыл бұрын
if(timer
@Ryan22_72 жыл бұрын
This is so simple. Why is every other tutorial so complex???
@upowlnight3 жыл бұрын
This tutorial is really helpful to me. I'm new to coding so at 6:14 I dont really understand why you would write public void first. I dont understand what that means when people write things like Public Void, Private Void, Void Start, Void Update. I just try to blindly accept it, but I feel like I should understand. Is there some good documentation for noobs somewhere?
@steegray46882 жыл бұрын
hey man, I only just started too but in case you were still wondering, here is a really basic and by no means comprehensive round up of what I've learned about it so far: void means it doesn't return a value, where things like float, int, or bool do, and is basically used to DO things as opposed to generate values. Public and Private basically means if that part of the code is accessible to other parts of the game/code or not. So if another script can use part of this one or not depends if it is public. Can also mean it's accessible from the inspector. Does that make sense?
@upowlnight2 жыл бұрын
@@steegray4688 wow, I appreciate the response. That was really helpful. So private void I can name stuff however I wish, and not worry if I use that name again for another variable in another void somewhere else.
@steegray46882 жыл бұрын
@@upowlnight I believe so. If it's private it means nothing outside that script and whatever object it's attached to can access, so you could call it whatever really. I'm still learning of course so if this turns out to be untrue I take no responsibility haha
@jglasshalfpool46405 жыл бұрын
Great tutorial. Thank you. I'm using this for a lap timer and am stuck trying to get minutes working. The timer just increments so 1 minute 22 seconds is shown as "82.00". Any pointers on converting this into a min:sec:millisec format?
@alecz1k2 жыл бұрын
pretty sure you solved this since your post 2 years ago but for anyone else, this tut helped me incrementing minutes:seconds kzbin.info/www/bejne/n6nPepSDqs2emK8
@DashMatin5 жыл бұрын
YEAH MAKE ME SUFFER BY USING THE LIGHT MODE
@Fartmeister2223 жыл бұрын
Lul
@CentroDocumentalSM4 жыл бұрын
This is really helpful. However, I haven't managed to stop the stopwatch once it reaches 0...:(....it goes on to -1, -2, -3....can anyone help me? I'm not a programmer, but I am trying to learn step by step.
@paulinox6682 жыл бұрын
Cuando se tenga un problema, busca tutoriales en ingles, son mas directos, intuitivos, y no te dicen "Esto es así, por que si" , si no que te explican la lógica que hay detrás esa a sido mi experiencia con todos los videos en ingles que eh visto.
@dennisgonzales95215 жыл бұрын
Can u make a tutorial about what and when to use Time.Deltatime and the Time.FixedDelta time? Thanks 😀😁
@Martin-hj4re5 жыл бұрын
how can I start a UI Timer with OnTriggerEnter? I've searched pretty much the whole internet
@pressstart68645 жыл бұрын
Using the code from this video, just set timerActive = true in your onTriggerEnter function, like so: public class StopWatch : MonoBehaviour { public float timeStart; public Text textBox; public Text startBtnText; bool timerActive = false; // Use this for initialization void Start () { textBox.text = timeStart.ToString("F2"); } // Update is called once per frame void Update () { if(timerActive){ timeStart += Time.deltaTime; textBox.text = timeStart.ToString("F2"); } } private void OnTriggerEnter(Collider other){ timerActive = true; } }
@SmashBros43393 жыл бұрын
@@pressstart6864 Is there also a way we can stop and get rid of the stopwatch when the gameover screen comes?
@ManiX2074 жыл бұрын
.. damn now how does one get this trnslated onto a Target game object.... (so if you hit hte target the timere starts, and if you defeated the target the timer stops)
@neozoid70093 жыл бұрын
How to make it as hour system??
@realtalkwithharris6053 Жыл бұрын
what do you mean "option key"?
@tumpperi38914 жыл бұрын
How did you get a dot instead of a comma?
@-Kadir_Demirci-3 жыл бұрын
The second start pause system doesn't work. I am sure ı did exactly everything like in video. But first worked.
@TDAdoesminecraft4 жыл бұрын
Hey cool vid but one question how do u make the stopwatch go so that it can go continue across scenes and not get destroyed
@jeankasumi4 жыл бұрын
How do I script a time stop when the game is over?
@walney20085 жыл бұрын
hello, how to do for the enemy to have an AI, where he passes by plane at the top and launches bomb, and this one goes towards the player that are towers? thank you
@Stunt_sector2 жыл бұрын
Когда я на on click ставлю Main camera нету функции StopWatch
@princesszelda20725 жыл бұрын
I need a countdown that works with minutes and seconds for a timed game mechanic
@emretasdemiir3 жыл бұрын
same here,anything?
@volokkolov95463 жыл бұрын
thank you
@azyjmexcuseokstop9243 жыл бұрын
shoulda used a coroutine if you are only conting seconds : as is, your first countdown uses the update function every frame while it could just use a coroutine every second, dividing performance hit by 60
@КонстантинЛактионов-щ1ю3 жыл бұрын
very cool
@nickarry5 жыл бұрын
Wow. Liked and Subbed! Question, how can i edit it so that the countdown timer only begins once 2 objects (which i've tagged in unity) collide? Thanks!
@karas95705 жыл бұрын
It's good but,It's notworking .if I create public void timeButton and use Onclick input Main camera when play mode time is stop in 0.00 and no can click nothing.
@rainoffire9194 жыл бұрын
when you decreasing timer with delta time you don't wanna go below zero actually to be negative number.Copy this code and you done: using UnityEngine; using UnityEngine.UI; public class CountDown : MonoBehaviour { public float TimeStart = 60f; public Text TextBox; bool stopTime = true; //Start is called before the first frame update void Start() { TextBox.text = TimeStart.ToString(); } //Update is called once per frame void Update() { if (stopTime) { TimeStart -= Time.deltaTime; TextBox.text = Mathf.Round(TimeStart).ToString(); //TextBox.text = TimeStart.ToString(); } if (TimeStart
@DonGT5 жыл бұрын
Would this work (this is just a test not an actual script) Public bool time; Void update() { If time == true() { Then insert the stuff you did in update } If timestart = 0; { Time = false; } If time == false { Debug.Log("Timer is at 0") } This took long to write cuz I'm on mobile but just asking if this would work for somthing to happen when timer runs out }
@erenaydin2 жыл бұрын
thans a lot
@dawaysss79872 жыл бұрын
Great tutorial but when it reaches 0 it keeps going to -1
@wellingtonhiciano29542 жыл бұрын
you miss the part to reset the timer back to 0 when it reaches 60 seconds
@thebrownfrog3 жыл бұрын
thanks
@NeedforSpeedMostWanted-yk4gz4 жыл бұрын
can we say timeStart = -Time.deltaTime; why cant this work ?
@mahmoudtarek45064 жыл бұрын
Just cool
@jakeboi14493 жыл бұрын
make a stop time tutorial
@YashSingh-rc1oq5 жыл бұрын
but how should we stop the time at zero coz its decreasing continously in negative
@pressstart68645 жыл бұрын
Just wrap it in an IF statement like so: if(timeStart