Unity Life/Energy Timer Tutorial

  Рет қаралды 7,624

Kee Gamedev

Kee Gamedev

Күн бұрын

Life/Energy or similar timer system for your unity games. Allow your players to rest from addicting to your games!
➥➥➥ MORE TUTORIALS ➥➥➥
Victory Effect ⇢ • Unity Victory Effect T...
Pool Manager ⇢ • Unity Pool Manager Tut...
Squash And Stretch ⇢ • Unity Squash and Stret...
Leaderboard ⇢ • Unity Leaderboard Tuto...
In-App Purchase ⇢ • Unity In-App Purchase ...
Social Share ⇢ • Unity Social Sharing T...
➥➥➥ SUBSCRIBE FOR MORE VIDEOS ➥➥➥
Never miss a video about Unity features.
Subscribe ⇢ www.youtube.co...
BGM: Arms of Heaven
#unity #energytimer #unitytutorial

Пікірлер: 36
@빛나는좋은날
@빛나는좋은날 Ай бұрын
Thank you so much! Thanks to you, I solved a painful problem that had been bothering me for several days. This is a very good video!
@souvik_saha
@souvik_saha 4 жыл бұрын
Thank you so much, sir. I've had searched like the whole internet and THIS is the ONLY tutorial I could find. Also, I made so many mistakes that I had to re-check many times. By the way, for those who want to make the timer without hour, use this: ("{0:D2}:{1:D2}",(int) t.TotalMinutes, t.Seconds) and those who want to start the game with full lives just add this 5 in the Load() method : totalLife = PlayerPrefs.GetInt("totalLife", 5);
@akashajith5392
@akashajith5392 4 жыл бұрын
Thank u so much. You saved my time. Please reduce background audio, hard to hear your voice.
@iampoole
@iampoole 3 жыл бұрын
Good job! I am super tired and this helped me as I could just copy your code and not have to worry about things not working :') Saved me an hour, thank you very much.
@TrevorPinkney
@TrevorPinkney 4 жыл бұрын
Easy to follow and works perfectly, I couldn't find a tutorial like this anywhere else, so thank you so much!
@DaveMarcanoR
@DaveMarcanoR 2 жыл бұрын
Working 100% in Unity 2021. Great video! Heres no video about this in youtube. Thank you so much!
@ukraineforever4505
@ukraineforever4505 2 жыл бұрын
Thank u so so so much. You saved my life, time and mental health! I tryed to code this myseft but nothing works, btw TY
@arashsh4513
@arashsh4513 5 жыл бұрын
this is amazing thank you, without this tutorial i can'n figure out how to this, It's too complicated for me
@ViewsandNarratives
@ViewsandNarratives 2 жыл бұрын
Thank you bro 👏👏👏
@staticphoenixstudios
@staticphoenixstudios 4 жыл бұрын
Thank you so much. I enjoyed your video your explanation was very well done. Thank you once more
@DementedMagician
@DementedMagician 5 жыл бұрын
Thank you so much for this!! I was just trying to figure out how to do this!! :-)
@zhiyongccc4087
@zhiyongccc4087 5 жыл бұрын
Thank you so much !!! That was so hard to find this kind of tutorial!
@gamedevsam
@gamedevsam 4 жыл бұрын
Thanks. You're awesome!!!!
@mahdialking9644
@mahdialking9644 4 жыл бұрын
Thank you bro Your work is very nice 🌹
@jeespu566
@jeespu566 5 жыл бұрын
Is it intended that you get 1 energy automatically at the start even when totalEnergy is set to 0? Or is it a bug? Also, I'd like to know how to set this up to use a database for saving and loading, instead of PlayerPrefs, because I want to avoid cheating. What would you suggest? By the way, you can make this a little bit lighter (and thus boost performance) by moving UpdateEnergy() from here ... UpdateTimer(); UpdateEnergy(); Save(); yield return null; to here totalEnergy++; UpdateEnergy();
@purnachandra5206
@purnachandra5206 4 жыл бұрын
Hey were is link to download the code?
@simblend
@simblend 5 жыл бұрын
If they buy infinity lives for 24h how to check if 24h have passed from the moment they purchase it?
@merandroid3993
@merandroid3993 5 жыл бұрын
Thanks i want this tutorial for my project
@jansvec3855
@jansvec3855 5 жыл бұрын
Hi. Thank you for thist great tutorial. I created it in to my Project. But i have an issue. I assgin "Use" button to my "Play game" button and when i hit my button and play for a while i lost all my energy in one use. And if i have 0 energy i can still play the game. Pls help. And sorry for my bad English.
@akashajith5392
@akashajith5392 4 жыл бұрын
Hay could you help me... I am trying to incriment the health through another scrip... but not working. 🙁
@nikobaclayo6878
@nikobaclayo6878 4 жыл бұрын
is there any way that i can make at the start full tank?
@superoyuntr461
@superoyuntr461 4 жыл бұрын
hi i am using this system in my game and i want to put a rewarded video too but when i watch the video i cant get the energy
@azharqureshi4885
@azharqureshi4885 3 жыл бұрын
I am facing the same problem.. When I watch a rewarded video, I can't get the energy did you find any solution. is that so, please let me know
@superoyuntr461
@superoyuntr461 3 жыл бұрын
@@azharqureshi4885 yep i fixed it but i changed the scripts
@martin-gaming
@martin-gaming 4 жыл бұрын
Can someone help me? If I have full energy, then I lose one. The timer does not start from the beginning, but then, for example, from 4.
@processor8267
@processor8267 5 жыл бұрын
I solved the starting from 1 issue. Just change the StringToDate script like this: private DateTime StringToDate(string date) { if (String.IsNullOrEmpty(date)) { return DateTime.Now.AddSeconds(restoreDuration); } else { return DateTime.Parse(date); } }
@wisnofitriansyah6704
@wisnofitriansyah6704 4 жыл бұрын
Thanks bro
@heidic1049
@heidic1049 5 жыл бұрын
Hello, Its not working for me. I have copied you full script and still doesn't work in unity 2019. Please help
@qowimmuhammad7049
@qowimmuhammad7049 3 жыл бұрын
Please make me tutorial video to make expired time then file exported to .exe or others extension,thank's a lot
@mythree1
@mythree1 4 жыл бұрын
if you want your energy tank to be full at the beginning..... Edit the Start function as follows: void Start() { if (!PlayerPrefs.HasKey("totalEnergy")) { PlayerPrefs.SetInt("totalEnergy", 10); // or what do you want to your need value Load(); StartCoroutine(RestoreRoutine()); } else { Load(); StartCoroutine(RestoreRoutine()); } }
@davekene
@davekene 4 жыл бұрын
Hi, I think there is an issue with the code. It works well the first time, but it keeps going more than 10 even if it becomes full.
@amritpatel3324
@amritpatel3324 4 жыл бұрын
Thanks for the tutorial but i don't know that how should I set the timer for minutes and also when I set the restoreDuration greater than 30 seconds it increases the minute automatically. Please help..
@ZahRa-xl8gn
@ZahRa-xl8gn 4 жыл бұрын
hi,I have same problem.are you find answer?
@williamthomsen3367
@williamthomsen3367 2 жыл бұрын
why the music!!1
@koubaamine6809
@koubaamine6809 5 жыл бұрын
You sound like mr.bean
@tusharagarwal5306
@tusharagarwal5306 3 жыл бұрын
That music is so annoying.
Timed Chest ( And a timer )- Unity 3D[Tutorial][C#]
29:31
N3K EN
Рет қаралды 41 М.
TOP DOWN MOVEMENT in Unity!
22:30
Brackeys
Рет қаралды 1,2 МЛН
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
Energy/Stamina System - Easy Unity Tutorial
11:41
Hooson
Рет қаралды 6 М.
How Much Money my Mobile Game Made (After 1 month)
5:24
SimonKv GameDev
Рет қаралды 1 МЛН
How to make a HEALTH BAR in Unity!
21:06
Brackeys
Рет қаралды 1,2 МЛН
OBJECT POOLING in Unity
17:23
Brackeys
Рет қаралды 435 М.
Unity Victory Effect Tutorial  (Confetti)
14:16
Kee Gamedev
Рет қаралды 27 М.
Simple Shop in Unity (Buy Items, Weapons, Armor)
19:00
Code Monkey
Рет қаралды 164 М.
Unity C# Intermediate Tutorial - Timers that run outside your App
20:43
Unity Rate Box Tutorial in 15 Minutes (Android & iOS)
16:51
Kee Gamedev
Рет қаралды 10 М.
How to make AWESOME Scene Transitions in Unity!
19:45
Brackeys
Рет қаралды 977 М.
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН