 Hey everyone, it is Crypto Grounds here and welcome back to another Unity Atom Game Tutorial video. This is episode 6.1 and today I'm going to be showing you guys different types of progress bars. I'm personally really excited for this episode because I think progress bars are pretty amusing and I have quite a few different types of progress bars that you guys can implement in your game. So if you find this video helpful and if you enjoyed it make sure you leave a like, subscribe to my channel if you're new around here and turn on that bell if you want to be notified for whenever I upload videos or go live. Anyways, let's just jump right into it. So first I'd like to explain that I have five progress bars. So let's just go in order. So this is the first one. It's just a normal bar. And then we have progress 2. This is just a circular pie chart one and three is a similar one but I have designed my own little progress bar so it's just like a thin circle. You'll see these in some places in different softwares or maybe games as well. This four is actually like a little star system. So I only have four stars in this example but you can probably change this up if you want to do like a health system or something like that. And then the last one is something I put in the background. So this is just an entire background so it just fills to the top like that. So let's start with how each of these progress bars work and like what's inside each of them. So for each of these except for the background one contains an image. So you see this darker one. This is the background. So this is what actually like holds the fill and the text. So you have this one here. It doesn't do anything. It's just a static background image. And then we also have a fill progress bar. So we set an image to the same one as our background here and then we can just adjust color to whatever you want and then you set the image type to filled and then you choose the fill method. So this one is horizontal and it starts from the left. You can start from the right side if you want but that'd be kind of weird in some circumstances and you can also choose like radial or something like that or maybe horizontal or vertical like that but again that may look weird in some cases. So this is a horizontal fill and it starts from the left. So you change the fill amount goes from zero to one. So if you haven't played with images like this before this is how they work. It's pretty basic. So each of these progress bars has a fill and a text inside of them or maybe placed below them. Each of these text displays a different form of like how full the progress bar is. So this one is just going to be normal percent with no decimal. This one is going to be a countdown when it's actually full. This one's kind of like just a rating system. So I guess it would be nice if you have like a HP system or something like that. And this one is also a percent but it shows one decimal in the background doesn't have any text because it's not really necessary in my example. Now I have coded all these already. So I want to show you guys them over a quick. Just remember that this is the first one. This is the second one. This is the third one. The star is the fourth one and the background is the fifth. The last one. So here's the code. So what the first one is going to do, it's going to fill once per two seconds or 0.5 times per second. So I do that by adding 0.5 times time dot delta time. And we do the same for all the others except we changed the rates. So this left circle one is going to be filling five times or once every five seconds or 0.2 times per second. The one on the right side is going to be filling once per second. So it's just time dot delta time. The star system is going to be filling once per 10 seconds or 0.1 times per second. And the background will be the slowest because I don't want to hurt anyone's eyes. But that would be filling once per 100 seconds. So now we know how fast all these are going to be filling up. Let's talk about the text. So for the first one, it's just a basic percent. So let's zoom in here. So basically what we do is that we grab the fill amount for that progress bar. We divide it by one and we multiply it by a hundred and that's how we get our percent because remember, progress bars go from zero to one. And if we want that 100 percent, we want to start at zero percent and we want to get to 100 percent. So we multiply that zero to one by 100 to get zero to 100. Now, I've also applied the F zero formatting just so we can get no decimals. The second one is going to be a time based thing. So this may depend on like what type or how you're using it because sometimes you may have a progress bar for like building something and you want to display like how long it's going to take. You're probably going to display this a little differently than I did. But since this is just me filling out a constant rate and it's not going to be changing, I just basically did one minus the progress bar or the fill amount and multiply by five. So remember, we're going from zero to one. OK, and when we're subtracting one by that, we're going from one to zero, basically. And we want to multiply that by five because this is going to take five seconds to fill. So it's going to go from five to zero. Now, the third one is pretty much the same thing as the first one, except I have changed the formatting to F one because I want to see one decimal. Last but not least, this is the star one. So this is out of four. So this one's pretty similar to the percent one. Instead, we're multiplying it by four because we want to go from zero to four rather than zero to 100. So we multiply this whole thing by four and then we just add ours of I by four inside of the string. After that, I have created a for each loop just to basically reset the progress bar every time it fills by one. So it does absolutely nothing. It's just going to keep going over and over and over again. So now that you've seen the code, let's actually run it. So I can show you guys in live action. So looking at it, there's a lot going on. So let's just start with one. So let me maximize this and let's just focus on one. I can't think I can see me like that. OK, so let's start with this first one right here. So this is filling one every two seconds and it's going from zero to 100 percent. It looks beautiful, looks great. All right, so this one, this is counting down from five to zero seconds. So you can see it goes from five, four, three, two, one, zero. Yeah. So you know how that works. All right, next one is this one. So this one feels a little faster. This is one every second. You can see it's going pretty fast and we have that one decimal. So it looks great. And the star system, you can see it's going from zero stars to four stars. So again, you can use this for like your health system or something like that. You can go fancy with that. And then there's the background. And in the background, you have this very slowly filling background. I'm not sure what you're really going to need this for, but I decided to go in just for cosmetic purposes. So now you know how each of these works. Let me just show you the settings for each of these progress bars. So I've already shown you the first one. It's just a horizontal fill starting from the left. Let's go to the second one. This one is a radial 360 and it just starts from the bottom. You can change right, top, left, whatever you want. But I'm just going to stick with bottom. Now it's the same thing with the third progress bar. And for the star system, you have the horizontal left fill as well, because it's starting from the left side and it's going to the right. So for the background, it's actually a vertical fill and we're starting from the bottom. You can start from the top and it can go down or start from the bottom. So you can use this for whatever you want. In conclusion, we have made a few different types of progress bars and these can be used for whatever you'd like. And I really hope you guys found these useful and we'll implement them in your own games or maybe even software. If you enjoy this video, please leave a like as it really helps out the channel and subscribe to my channel. If you're new around here, we're on our way to 5k, so we're almost there. If you want to be notified for whenever I upload videos or go live, make sure you turn on that bell and set the notifications to all of them so you get notified for everything. If you want to support the channel or if you want to become a beta tester for my games, hop on Discord, the links in the description below and join my Patreon or become a channel member. Anyways, fellas, this is the end of the video. I hope you guys enjoyed this one and I hope you guys have a great day or night. I will see you in the next episode 6.2 and that will be on Smooth Progress Bars, so we're going to get a little fancy with these. I will catch you guys in the next one. Again, thank you for watching. Peace.