 Hello guys crypto grounds here welcome back to another idle game tutorial video this episode 19 and today We're going to do upgrade unlock So basically what I'm basically what I'm gonna do is that you need a certain amount coins or to see the next upgrade All right, so this should be a pretty basic one That's high. Let's hop right into it. So first of all, let's launch our main script, which I have open Okay, so I'm gonna add a few game objects here which we have Four upgrades and I'm gonna make them up here when we have half the amount of coins or total coins because For our achievement video. We already have the coins collected, right? So we're gonna do half of that. Okay? So I'm gonna add four game objects at the top. I'm just gonna label this episode 19 Public game objects click upgrade one And then we have click upgrade two and then we also have our production upgrades Production upgrades All right, and now in updates Let's see. We need to go to our upgrades group that we did in our optimization video, which I believe was episode 17 In here, we're gonna do This will be out. So we're gonna do if Coins dot collected or this is data, right? If coins dot date No, it's data dot coins collected is greater or equal than five Then we're gonna do click upgrade Game object dot set active true Okay Otherwise, it's false else false Okay That's kind of just good. This is kind of like a way to bring mystery into the game see like New features you can either have them like grayed out. So you what you can do is We can set these game objects to buttons To button and you can do click upgrade one dot enabled So you can't interact with it, but it's kind of a mystery thing But I'm gonna do game object just because I don't want to be able to see it Okay So back to here Also, we can convert this to a question mark operator, which we'll do that So we'll do click upgrade dot game object set active and then inside It's basically like an if statement inside this which is this is either true or false It's coin collect. It's greater equal than five true or false and this is pretty easy We could just copy and paste that for the rest click upgrade to production upgrade one and two and Now so let's we're gonna do the cost so we have 25 10 25 right is that our cost? I don't believe that is okay right here We have a cost so for the click upgrade to we're gonna do 25 Production upgrade we're gonna do 25. Actually, we're gonna do we're gonna do 15 And then for production upgrade costs to or production upgrade to I'm gonna do 250 so make sure you have click upgrade one click upgrade to upgrade production upgrade one and Production upgrade to so you can do this for whatever you want as well So this was kind of cool If you want to have a certain feature like if you want to have if you want to have like a Prestige upgrade which I could do in a future video to if you want to have a prestige upgrade And you don't want that to appear until you have at least 10 which are prestige currency gems You can easily just do data dot gems greater equal than the amount you want all right That should be it for that and now let's go to our upgrades screen So now we have everything all kind of spread out here So I'm gonna make a new game object for each one of these so create empty. This is going to called click upgrade one game Object this is kind of like our parent. This is our parent object and we're gonna put all of these inside So before you do that what I like to do is Kind of resize it to whatever is inside and then we can let's see how do we anchor all these nothing? All right, so then in here we can just Bring all of our clicker click upgrade one stuff to the game object And honestly, this is the same size for everything. So actually before we do that We can copy and paste this for our other three So we can do click upgrade to game object production upgrade Upgrade one game object And then we also have our production to game object Okay, so then now I like to move all my stuff So they match they align so this one's a little smaller because we don't have the progress bar So we can just resize it accordingly And then We can drag everything inside So tip is that if you want to add more stuff and you want to resize this um Kind of does a weird thing like this So if you want to add stuff below this what you can do is anchor everything to the top inside here So then you can just drag this down and add something else But if you want this to fit everything inside perfectly what you can do is drag everything out And then resize it and then move everything back in However, I'm just going to make everything anchor to the top Inside inside the parent game object And then we have our two cool And that is it for that. So now we got to go to our game manager scroll down drag click upgrade one to production upgrade and production upgrade two So let's save it. So now we should see our stuff because actually no, I just deleted my saves So we should be able to test this live So we are main screen. Let's go to upgrades. We don't see anything but once we Get let's get five dollars. We still see nothing five dollars. We see our first upgrade. Cool Let's get to 10 you can buy that Oh, we just saw a negative. What happened there? Oh, so yeah, now we have our second one See what's production upgrade one 15. Yeah, okay. Let's buy. Yeah, because it's total coins collected. So let's buy that Okay, I don't know why what that negative was I kind of missed that And now we should start unlocking more upgrades Let's get the 250 I love that smooth progress bar. It's very satisfying and there we go. We have our four upgrades Anyways, that is a very short tutorial. Hopefully you guys like the shorter videos I'm going to try to not make them an hour long because that last that last episode was way too long But yeah, hope you guys enjoyed this video if you did make sure you leave a like Subscribe to my channel if you're new and turn on the bell for future videos. Anyways, thanks guys. Peace