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

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

Dani Krossing

Dani Krossing

Күн бұрын

Пікірлер: 30
@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
@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!!
@TheDuccyGaming
@TheDuccyGaming Жыл бұрын
The dani dev with an upload schedule:
@JameNotLame
@JameNotLame Жыл бұрын
what is the gamemanager script
@victorverbeke
@victorverbeke 11 ай бұрын
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 11 ай бұрын
Don't drag the entire canvas into the serialized field. Only the object the HealthBar script is attached to.
@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 6 ай бұрын
When I try to add the HealthBar script to the HB_Fill it says “the script class cannot be found.”
@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!!!
@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 10 ай бұрын
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
@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 11 ай бұрын
I get this same thing, and was wondering if you found out what it was
@Naveed22666
@Naveed22666 9 ай бұрын
Same
@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)
@Naveed22666
@Naveed22666 9 ай бұрын
I am getting a null reference error. Why is that I wonder?
@Dani_Krossing
@Dani_Krossing 9 ай бұрын
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 9 ай бұрын
@@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 11 ай бұрын
pls
@Dani_Krossing
@Dani_Krossing 11 ай бұрын
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.
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
How to make a menu in Unity - UI Tutorial
26:27
Tarodev
Рет қаралды 192 М.
Exploring Abandoned Games From Your Childhood
20:00
globert
Рет қаралды 41 М.
2D PATHFINDING - Enemy AI in Unity
23:13
Brackeys
Рет қаралды 827 М.
Three Cool Health Bars in Unity (2024/2020)
6:14
CDisco
Рет қаралды 61 М.
PAUSE MENU in Unity
12:13
Brackeys
Рет қаралды 998 М.