 Many games display health bars to visually represent how much health an enemy or player might have. It's a lot easier to parse than a number when you're quickly glancing at it. Some games even display both a number and a bar. I've got a simple demo here where when I press the spacebar the health of this icon could be the player decreases and when it goes below zero it resets to five. So we've got a value that's changing and we want to represent it in the UI. Godot makes it really easy to add a health bar. In our main scene if you just type in bar you'll find this progress bar label and it's so great for making quick simple clean health bars. So add a progress bar to your scene we'll just call it health bar and we'll expand it out to make it a little bit larger and we'll place it right here in our game. Now in the inspector you'll see a few different options already. Fill mode beginning to end so you can make it fill left to right or right to left and that sort of thing. You can toggle on and off the percentage. We're going to toggle it off because that is um we don't necessarily want to show it here because it's more of a health bar instead of like a loading indicator but this could also be used for a loading indicator. We're going to set our max value to five just so that we have a max that it can use but we'll in the code we'll set that dynamically. We're going to change the step to one because we're going to increment it in one there's no partial health points and then we're just going to save that. In the script or in the code we've just got some simple things. We set the label value on ready via function and then we damage the player when the space bar is pressed and that decreases how if the health is less than zero we reset it to max health and then we set the health label to that text. So then all we need to do here is you know let's go we have health bar and let's refresh on the properties really quick. We have min value max value we're going to leave min value zero max value we're going to set to our constant max health and we're going to change the value of it on damage to set it accordingly. So we'll say we'll say set health bar we'll make that a function doesn't exist yet so we'll go ahead make that funk set health bar and maybe we'll also say health bar dot max value is equal to max health. This is all just in the main scene but you know you could associate this with a player scene or however you want to approach it but then the set health bar what we do is we'll just say health bar dot value is equal to our health variable and that's it so in terms of getting this set up so we have the max value that we set and then we set the health bar amount accordingly and then here after we set the health we just go ahead and we say after we say set health label we'll just say set health bar now if we rerun our game you see it's full if I press the space bar it decreases goes down to zero reset back to five and it decreases so all you have to do is take the node set the value to a number amount and you've got health bars in a very short amount of time we can go ahead and make this code a little better like we can say like update health UI make that our own function and then we'll just take this here here so it's a little bit cleaner we could even put these functions since they're just one liners in here but if those got more complicated we might want them to be in their own functions so we go ahead and run that again make sure it still works yep everything's working so there's how to add really simple health bars in Godot I think the default styling is actually quite dapper but there are ways to adjust it with the theme settings here I don't know too much about that yet though so I when I learn it I'll make a video about it but for now these simple health bars work pretty well and hopefully that helps you if you need to add them to your game thanks for watching