HOW TO MAKE A HEALTH BAR IN UNITY 🎮 | How to Make a Health Bar for Beginners | Learn Unity For Free

  Рет қаралды 20,676

Dani Krossing

Dani Krossing

Күн бұрын

Пікірлер: 30
@JV-cz7db
@JV-cz7db Жыл бұрын
AMAZING it worked again thanks so much for your videos, they are the best on youtube because you show every step precisely.
@marissamoser407
@marissamoser407 2 жыл бұрын
SO thankful for these videos!!
@AnastasiKoko
@AnastasiKoko 2 жыл бұрын
Danii, could you please somehow show how to implement animated sprite to the bar, so maybe the red part is not static but it is glowing instead or smth
@TheDuccyGaming
@TheDuccyGaming Жыл бұрын
The dani dev with an upload schedule:
@Shelbyy476
@Shelbyy476 2 жыл бұрын
You always help me a lot...
@keanovdbesteham7363
@keanovdbesteham7363 Жыл бұрын
Hello Dani, At first thank you! You helping me always, But do you have an Link for the Overlay and the heart? they look so good!!!
@royal_striker_6095
@royal_striker_6095 2 жыл бұрын
Nice Tutorial
@Hidesinmud
@Hidesinmud 5 ай бұрын
When I try to add the HealthBar script to the HB_Fill it says “the script class cannot be found.”
@victorverbeke
@victorverbeke 10 ай бұрын
i did everything in the tutorial but at the end i just couldn't drag the canvas into the health bar box. Can you please help me with this.
@sladnam7480
@sladnam7480 9 ай бұрын
Don't drag the entire canvas into the serialized field. Only the object the HealthBar script is attached to.
@JameNotLame
@JameNotLame Жыл бұрын
what is the gamemanager script
@phillipwebb1104
@phillipwebb1104 Жыл бұрын
Awesome video, as always. I’ve tried so many health bar tutorials and all have the same result. The position I place it in is never the actual place when in game. Any ideas at all? I have the same canvas settings as you
@isaacashton5772
@isaacashton5772 9 ай бұрын
My best advice is make sure you’re placing it where you want in the Canvas, not the Camera. It should automatically sync! and yeah it’s been a few months😅 but hope this helps
@OfirHadad
@OfirHadad 2 жыл бұрын
I believe that until you answer I will find the solution, but for all others that will come, what is the right way to call PlayerTakeDmg from an Enemy script? BTW, Great TUT!
@Dani_Krossing
@Dani_Krossing 2 жыл бұрын
You are gonna want to do it in a way that doesn't break anything, if you later decide to remove that enemy from your game. 🙂 The way I do that is by running a OnTriggerEnter (or OnCollisionEnter) function in my EnemyBehaviour script, and when it registers hitting the Player I simply reference PlayerTakeDmg inside the collision function. Doing it this way won't throw you any errors later on, if you decide to delete that enemy. But it really depends on how YOUR game is set up, since there are many ways to go about it. This is one method that I like using. 🙂
@OfirHadad
@OfirHadad 2 жыл бұрын
​@@Dani_Krossing Thanks for the fast replay! I used your mana regenerate video to somehow do something like that. I would like your opinion if it's ok to do something like that. I added to the game manager ta [SerializeField] PlayerBehaviour and a public void PlayerTakeDmg method Inside this public method I call _playerBehaviour.PlayerTakeDmg(dmg) And then OnCollisionEnter (of the enemy) I'm calling GameManager.gameManager.PlayerTakeDmg(AttackPower); What do you think, Is this the right way to use the GameManager or should I have something like a new PlayerManager? (I'm still a beginner in Game development)
@Pwegoable
@Pwegoable Жыл бұрын
unity 1.15f.... there is no image option only UIDocument, double clicking canvas zooms in twice then back once. all unity tutorials are for older versions and unity 1.15 seems baad
@sckosta
@sckosta Жыл бұрын
Hi, i'm new to this chanell, can you please tell me how can set this to unit script how you are show to the other video? Thanks!!!
@ggame1022
@ggame1022 2 жыл бұрын
How can you change the color of a specific word
@willswingler
@willswingler Жыл бұрын
I keep getting NullReferanceException: Object reference not set to an instance of an object error. This is happening in my health bar script but I think its because the health variable is not passing through.
@juventinopacheco2888
@juventinopacheco2888 9 ай бұрын
I get this same thing, and was wondering if you found out what it was
@Naveed22666
@Naveed22666 7 ай бұрын
Same
@Naveed22666
@Naveed22666 7 ай бұрын
I am getting a null reference error. Why is that I wonder?
@Dani_Krossing
@Dani_Krossing 7 ай бұрын
It means you are trying to reference something in your code, which can’t be found. So either you made a typo in your code, or you forgot to drag something into the inspector, inside Unity. 🙂
@Naveed22666
@Naveed22666 7 ай бұрын
@@Dani_Krossing I don't think I forgot to drag something. That said I am not getting any errors in the script but the issue is probably in the Health Bar Script as I am getting this error when I try to access the SetMaxHealth() function and SetCurrentHealth() function in that script in the PlayerBehavior script with GameManager.gameManager._playerUnitHealth.health
@slogannots3366
@slogannots3366 2 жыл бұрын
But how do you make a health bar in real life?
@Dani_Krossing
@Dani_Krossing 2 жыл бұрын
You buy a smartwatch ;)
@victorverbeke
@victorverbeke 10 ай бұрын
pls
@Dani_Krossing
@Dani_Krossing 10 ай бұрын
I'm gonna need more text to understand that comment. 😂
@cheesewizard3659
@cheesewizard3659 Жыл бұрын
Bruh I'm spending hours trying to figure out how to implement this health bar system on an ememy basically this method worthless and a ded end since you don't have a way showing us how. The cross cross through the game manager it's hard to decipher and rewrite what's going on through it not through it.
How to make a HEALTH BAR in Unity!
21:06
Brackeys
Рет қаралды 1,1 МЛН
Walking on LEGO Be Like... #shorts #mingweirocks
00:41
mingweirocks
Рет қаралды 7 МЛН
СОБАКА ВЕРНУЛА ТАБАЛАПКИ😱#shorts
00:25
INNA SERG
Рет қаралды 3,8 МЛН
What type of pedestrian are you?😄 #tiktok #elsarca
00:28
Elsa Arca
Рет қаралды 20 МЛН
Ice Cream or Surprise Trip Around the World?
00:31
Hungry FAM
Рет қаралды 16 МЛН
Easy Heart Health System in Unity
16:03
BMo
Рет қаралды 20 М.
How to make a menu in Unity - UI Tutorial
26:27
Tarodev
Рет қаралды 190 М.
3 UNIQUE Health Bar Damage Taken Effects (Unity Tutorial)
26:16
Code Monkey
Рет қаралды 50 М.
How to make a Better Health Bar in Unity : Chip Away Tutorial
14:05
Natty GameDev
Рет қаралды 95 М.
Making UI That Looks Good In Unity
18:06
Game Dev Guide
Рет қаралды 688 М.
How To Create 2D HEART/HEALTH System (Unity Tutorial 2022)
10:06
Walking on LEGO Be Like... #shorts #mingweirocks
00:41
mingweirocks
Рет қаралды 7 МЛН