 Hello guys grip the grounds here welcome back to another unity anti-matter dimensions video today We are going to be working on achievements if you enjoyed this video make sure you smash a like button Subscribe to my channel if you're new and Charles notifications for future live streams and videos and also comment all your questions feedback all that good stuff below Yeah, it's another one of these videos where I've been gone for a really long time I've uploaded a grand total of four videos actually now five like five Videos yeah, six videos this month. Damn. I'm doing terrible. I feel deeply sorry guys But good news. We're very close to two thousand subscribers already. Yay, so that's good another bad news I'm losing views. It's okay. I just need a post more often I was getting at least around 1500 and now I'm back at 1000 so I need to fix that I need to get back into the game. So yeah, anyways, I've been really busy with school starting and hockey Starting as well and working very hard on my game doing a bunch of bug fixes and all that cool stuff So yeah, anyways, let's pick up the anti-matter dimensions to use again because I really missed working on this But yeah, anyways, let's get ready for the achievements. So I'm just gonna set up the UI real quick Okay, so now what I did here is that I made a new game object to put my dimsack and my dimensions inside And I anchored it to stretch so that I can Do this and it stretched just fine and I also made an achievements empty game object here as well and It's the same place Same same same and I also added the achievements button. Okay, so now I'm going to start working Let's actually take a look at the achievements. Okay, so now I'm gonna do a different achievement Kind of style rather than what I did in my idle game tutorial video So if you're here just to learn how to make achievements. This is a great tutorial for you But basically what we're gonna do is that we're gonna sign each achievements as an ID now I'm not gonna do any of the arts. I'm gonna do like the titles and stuff But I'm gonna basically I'm assigned every single achievements as an ID. Okay, and we're gonna do the same Achievement multiplier and stuff like that. Okay, so of course we're not gonna get all of them But I'd rather get some Play for eight days extremely small time multiplier and I don't know what this is So I'm just gonna like ignore some of these achievements. What I'll pull it do is the first two I think I'm gonna do the first two rows so that's That's the how many are there eight in each row. So that's 16 achievements. That should be too bad I might do just one. We'll see how this video goes but so basically we're just gonna do by a single dimension a second third fourth fifth sixth seventh and Eighth pretty easy. So yeah, I actually could do two rows since that's really easy and reach infinite anti-matter and Encounter 50 different news messages. So this one word. This is just gonna be like a null thing So I'm just gonna leave this as an empty one for now Probably just like like my own achievements Have exactly 99 eighth achievements and I also have some of the rewards too And yeah, we'll just do the rest of these. Okay, so anyways, let me just set up my interface once again for the achievements Also, just wanted to mention that I am not doing the secret achievements since it really has no in-game benefits So I'm not going to do that Okay, I'm back. So basically the one of the things you're gonna learn in this series is efficiency, right? So we're not gonna just copy and paste this one achievement, right? We're gonna create a prefab out of it to make our lives a lot easier. So we have our achievement here we can honestly just put achievement title in here and Then once we are done with that we can just drag this achievement Actually, no, no, not yet. Not yet. I forgot one more thing I'm gonna keep this button here because we don't actually I'm gonna get rid of these button this button right here Because if we don't interact with it, it's automatic, right? So We're gonna create a class. Okay And this is gonna be called achievement If I can spell it right first of all, so we're gonna create the achievement script and This will be a thing that we can assign to each now. What's really easy about this is that when we Create our ID system We can look through all of the achievements and then give them an ID and basically what we're looking for is the achievement script game components because we can do we can Look for game components inside our achievements right here. So basically we'll just look for this and whatever game object has it will add it to a list and Yeah, it's it's really cool how this works and it's much easier than just having to drag all of our text and manually and This is easily expandable too Okay, so it's very easy. So we're gonna have two scripts We're gonna have this one and we're gonna have the achievement manager now I'm gonna finish this one first because we kind of have to create our prefabs and our objects first of all And then we'll create our achievement manager So as writers opening up we can delete pretty much all of this and Yeah, we can get rid of this too Really the only thing we're gonna need in here is the image because we want to be able to change the color once it's done so we're gonna just We can just give an achievement and also we want to implement the Unity engine UI interface Okay, so now we have our public image and we also need our public image Achievements we also want our text too. This is just gonna be the title text and that's all we got to do in here Right, it's just a net. It's pretty empty Okay, so now what we can do here is that we can assign our image and our text. This is a TMP text I forgot so we actually have to Additionally import the using a TMPro and replace this text with a TMP text Okay, and now we should be able to drag this text because basically all the text we're using in this game is TMP text or text message pro Cool, so now that's we're done with that. We can drag this achievement game object into a prefab folder cool, so now we can just Simply position this however we'd like. I'm gonna do that. I'll be right back Okay, so I finished that if you guys want the exact dimensions So basically what I did is that the row is 1470 by 175 also want to anchor this at the top like that and each achievement is 150 by 150 and They are evenly spread out by I think 35, right? Let's do the math or click I think it is I think it's 35. I Hold on one second 185, okay. So yeah, they're each spread out by 185 pixels And yeah, so it looks like that so I'll show you this one and this one And you should pretty much be able to figure out from there. Anyways, let's actually start getting ready for the code And I'm just gonna leave these titles as it is because I'm just gonna make this Achievement zero to stay consistent. So I'll have to change them all now. This is gonna be our ID So we're gonna do zero based index. So There's zero index instead of one. So we start from zero and we end at seven instead of one through eight Okay, so now what we're gonna do is go to our scripts We're gonna create an empty and it's gonna be called the achievement manager Okay, and now we're gonna create a separate script called the achievement Manager Okie-dokie and I'm gonna let that create itself and So that looks a little off actually no, it might be just my eyes. Also, this green is just for our This like that. Okay, and Once it's complete for example, we'll just set it to green like this. Okay, and once they're all done we will set it to We'll set it to green and before this will be this green bar would be gray. Okay. Anyways enough talking. Let's just get started Okay, so there's two things we're gonna have to look for in order to find these achievements We need to have a game object in order to find these right? Okay, so we're gonna have actually no sign of game object. Oh, yeah, it is a game object because we are locating Inside a game object. So we're not gonna look from a row Okay, actually, I think we might have to I'm not sure but let's just try achievements for now Okay, and I might have to actually create a separate gate a separate prefab or like a separate script for this row So I'll have to search for every row look for an achievement. So we might have to do that I am not completely sure but we will we are here to experiment. So I'm gonna create a game object Okay, and this is gonna be called our achievement screen Okay, and we're gonna create a list And so so far it's empty and it's gonna be a list of achievements. Remember that achievement class we made earlier and it's gonna be called a Achievements and it's gonna be a new achievement list. Okay, and we also need to import System.collections.generic which is where lists come from All right, and that's all we need from up here for now And let's just start this in a public void start. Okay. So now what we're doing is we're gonna look through all We're gonna look for all of these right here. Okay So basically we do For each var Achievements, so I'm just gonna do ach for achievements Okay, inside achievement screen dot get components in children. Okay Now remember it says get components in children Okay, and now in here we're gonna put in our type and that is achievement like that Let's see Oh, it's the other way around oops Like that. Okay, so we're creating a for each statement. So basically we're gonna look for all of We're gonna look through all of our game objects and whichever one has an achievement A component inside one of those we're just gonna add it to our list which we do in here So to add it to our list all we gotta do is achievements dot add And then we do ach Very easy Now I'll show you guys this in a second. Actually, I'll show you this right now. Okay So you're not gonna see anything special, but you're gonna see this list right here fill up Which is really cool. So for our achievement screens. We're just gonna drag this achievements right here. Okay Save it and run it and we'll see this this list fill up. Hopefully if it works. Okay, cool. So it did So you see now we have access to all of our achievements here. Okay, so we can we basically Don't even have to assign an id right because the id is the index of these um Right here, right? So we're basically gonna go through each row And so on so here if we copy and paste this row and go under it, which we're actually gonna have to do anyways Uh Row two, I guess And so if we have these under you're gonna see how it's gonna basically go through row one first and then row two So let's save it and go to our achievement manager and observe Cool. So we have a 16 achievements. So basically it goes through row one first and then it hops down to row two So now what are the benefits of actually doing this? You don't have to drag every single text and image and I'm there are a lot achievements You can obviously see and look at all these achievements. I don't think you're gonna want to drag all of these texts over and over again And these images. I don't think they'll be very fun So this just saves you a lot of time and it allows you to expand it whenever you like you can add achievements However, you like wherever you'd like and whenever you'd like. Okay So we have the achievements. We have access to them We have to actually start like setting them, right? Okay. So what we're gonna do here is I'm gonna create a dictionary Okay, or you can create a list too. Both are fine. But actually let's create a list Okay, so we're gonna create a string list and honestly we can create an array Hmm, which one should we do? I think we're gonna do Oh, sorry, um, I think we're just gonna do a list. Okay, and this can be uh achievement names Okay And now the thing is we can pre define these and we can uh easy modify these anytime without having to interfere Okay, so let's see. We want to grab Our achievement names from here. Okay So I'm gonna do this myself, but basically I'm just gonna grab the first 16 here. Okay. I'll be right back Okay, so I finished the list of achievements and I also just wanted to mention that I added my own achievement to replace fake news Um, because I I I will probably add the news ticker at some point, but I replace it with floating anti matter. So basically Crypto clickers reference. I'm going to be doing 3.40 e 38 And a matter and you get this achievement. Okay, so that's really what this achievement is going to reward And so I'm going to split these achievements in groups of eight. So we'll just press enter right here Okay, so we know that these are the first eight and so on Okay, and Oh, yeah, I also wanted to add Um, so we're gonna have lots of rows eventually. So let's just add this row component, right? So we're gonna create a new script called a row. Okay Now I know these might be really pointless things to do You can easily just drag in a few rows and it's like no no biggie But I just want to stay consistent on how we are efficiently doing this And uh, basically this is just an image component. Okay Okay, we also need to add the unity Unity engine.ui UI Name space, okay, and now what we're going to do is we're going to create a reference not a reference, but a We're going to drag this image into here and we oh shoot. I should have done it here It's okay. It's okay Uh, let me just slide this up Okay, delete that row Okay, so we're gonna this is gonna be a prefab, okay And I'm just gonna drag this into our prefabs folder and there we go. Voila So now our row prefab is basically just a bunch of achievements So you can just drag this in now and we have another row of achievements. Very cool And we're gonna name that row two and this will be row one. Okay So now what we're going to do in our achievement manager is we're going to create another list. Okay And this will be for our rows Okay, I could should have named this row better. I should have done like achievement row or something, but it's okay So it's going to be a new list of type row called rows And it's going to be equal to a new list of type row Okay, and now in our start method, we're going to do the exact same thing So I'm just going to copy and paste this var row is equal to or var row or sorry For each var row and achievement screens gig opponents in children and we're going to do row instead. Okay And now we do achievements dot add so replace achievements with row and replace Ash with row like that. Okay, so now it's going to basically search for all of our rows And add them to our achievements Our rows list right here. Okay Cool. So now what we're going to do here is we need to find a way to Set our achievements to To complete right so instead of just having a stat So this is a mistake I made with crypto clickers or something like that Or like when you like unlock something from a milestone The thing I did wrong is that I would keep check I would set like a highest so let's say I get to e308 We right or sorry ethereum So let's say I get there The problem is that I set the highest to e308 And it's based off of that which can cause issues if that gets nan and it gets screwed So what I'm going to do here instead is I'm going to make a method where we basically set the achievement to true And we only need to check it When it's false, right? So that's how the steam achievements work. Okay So I'm going to do the exact same thing here. So let's create a method called unlock achievements Okay, and we're just going to have an int id in here. Okay And remember, we're only calling this if this is false. So really there's no need to do this Now before we continue before we carry on we need to be sure that our achievements List is up to date Now the issue with this is something that I think we're going to have a little bit of struggles with It's this right here. It's data Okay, it's creating a list in here. Okay So we need to be sure to constantly update this list. Okay So let's just add a list in here and this is just going to be an int Now we're not doing it all right because it's easier to add on to this list. Okay So this is going to be our list of achievements IDs Okay Actually No, we're going to create a dictionary instead Actually, no our system doesn't support Does it I think it does Are we doing Uh binary formatter convert to base It looks like yeah, it looks like we're stood. Oh, we're not doing json. Okay, so we can do dictionaries. Phew. We're safe Okay, so basically we're going to create a dictionary For our oh really you don't have to okay Sorry guys We're gonna we're just going to do a list for bulls because we're doing a zero index Uh system for our IDs. Anyway, so it really doesn't matter Okay And this is gonna be a new list and for now the size is 16. Okay We're gonna have to change this which is a little tricky. Okay So we're gonna put this in our data, okay Now in our achievement manager, I'm gonna close all of this because it's really not necessary Um In our what's this right here? Oh, yeah, we can close that So in our start method, we need to Detect to see if this achievement unlocks is good enough now instead of checking to see if it's good enough We want to expand it. Okay We want to add on to it rather than replacing all of our current unlocks because that will just make people Angry when we add new achievements. Okay Also in our data, I forgot we need to do something. Okay So an issue with creating a new list right here is that it doesn't actually do it properly. Okay So we're gonna have to search up a C sharp Create new list. I'm not working. Okay, so I can't remember what the exact thing is Uh Let me let me find that real quick hold on Okay, I found it. So here's the method that we need to add to ours Our script. We also need to add system dot link dot innumerable So make sure you add that the top make sure you have all of these right here. Okay So The thing with creating a new list is that the capacity is like stuck All right, when we create a new list, it doesn't like expand. I don't know It does some weird things where it just sets the list to a size zero So to fix that we replace this new list with a private static list type t Which is a bull right here. For example, our generic type Uh, create list generic type and capacity. Okay, and I basically I don't not exactly sure how it works but basically it just creates an Uh, a new list properly. Okay, so we're going to replace this with a create list with a type bull Okay, and we're going to set the capacity to 16. Okay, and that should be safe And we can honestly probably get rid of this too And yeah, it's fine. Okay. Um, okay, so now we can just leave this as is Okay, so now let's go take our let's go fix this issue right here Um, so let's see we need to find the achievements count. So let's see if uh, our achievements dot count Is greater than or is greater than Um data dot. Oh, yeah, we need to implement our game manager. So that is, um What is it dimensions? Oh, it's game controller. Right Okay, so we're gonna add our game to the top And we're going to do game dot data dot achievement unlocks dot count So basically if this achievements count is greater than our achievement unlocks, then we need to add some more Okay, so now we do that by Creating a for loop and we need to just add in Um, some more falses. Okay. So basically we're just going to do var is equal equal to I equals zero. I is less than Um, we're going to subtract these counts together Okay, you know, I'm I'm really hoping this works. I think it should I'm kind of just experimenting here so basically We're going to add To our uh game dot data dot achievement locks and actually let's create a variable here called data equals game dot data Just so we don't have to write game dot every time Okay, and now we're just going to do data dot achievements Unlocks dot add and we just put in false. Okay. So now it's just going to fill in until we are equal. Okay And I think we could just set that to inverse and you know, let's get rid of these brackets cool Okay, so now when we unlock an achievement, we basically just need to Set this equal to false. Okay. So we do game dot data dot Achievement unlocks and we're going to set that to true Okay Oh, right You gotta do at id instead of equal to true Okay Very self-explanatory and I think I'm going to create a method where we update our achievement UI because we want to save as much Um cpus we can We're just going to create a method called updates Achievement at UI And this will be called Wow, I cannot type and this will be called whenever we unlock an achievement and when we start the game. Okay At the very end Okay, so now when we update an achievement, we need to scan through all of them And honestly, we could probably have another Like a secondary update achievement in here where we can do public void update Specific achievements UI so we could save even more Even it's not going to really matter because we're going to get achievement like very little and at a very little pace I guess a very uh Long interval so it really doesn't matter But just for the sake of it, we can just do int id here. Okay And we need to have access to our our achievements here. Okay So Now we just basically do Achievements at index id and we want to change the achievements. Okay Um, so we're going to set achievements equal to Uh So, wait, what is this? This is yeah, so we're going to set this to uh, we're going to set the color to Um, let's see I think yeah, we just need to do game.data.unlocks Right at index id Question mark and basically we're just going to differentiate between The these two colors here So our first one is this red We could just set that to that Very easy And honestly we can just do new color And this is an rgb anyways, so we can just do one zero zero. Okay So now we're setting it to this color if it's locked. Okay, so that's locked. Okay, so we need to um Do green first so new color and we're just going to do rgb Okay, so when it's unlocked we set it to green if it's not then we set it to red Okay And honestly we can run through this in a update achievement ui So we can do var i equal to zero And we want to stop at our achievements account Okay So when uh for var i is equal to zero and i is less than the achievements count We're going to add by one And in here we simply just update specific ui Okay, so now this is very easy. We don't have to update all of the achievements at once We can just do one when we unlock it, right? And we're just going to set we're just going to insert i in here Okay So the only time we won't really want to call this update achievement ui is at the very start. Okay And also we want to check for We need to do something with our names here because we haven't done absolutely anything. Okay um, so what we're going to do here Oh, yeah, we want to update specific ui here Right, and we're just going to put our id in here um, so in here now We need to set the text and now obviously I could just do that in here Let's do that because we only need to do it once so we're going to create another var i is equal to zero And if i is less than or not if And then we're going to keep doing this till i is less than As long as i is less than the count we're going to add by another i plus plus And now in here, we're going to set our achievements dot or at uh, i Yeah Dot title And we're going to set this equal to the achievement names at index i Uh, is that right? Oh, yeah, it's gotta be that text. Uh cool very easy Very easy to do it quick. Uh, man, I thought we're going to be able to convert that to for each bike is not Um, so yeah, that's a very easy way to set all of our titles only once because that's the only time we ever need to And we're honestly very close. We now just pretty much need to do the unlock achievements and this row right here. Okay So we need to do update row ui. Okay, so we have the we have the ui What about the rows? So we're going to make another method called updates row Ui and obviously i'm over complicating this by adding a ton of u Methods, but i'm really just trying to keep myself clean and trying to reduce how Like, um, how many times certain things need to be ran And also all of these can be private methods since they're only going to be accessed in this method in this class Uh, even start honestly Thanks, you know, i'm gonna leave it. I'll probably do it after data. So i'm gonna do start achievements actually Yeah, like that. Okay. So now for our rows is a little different. So we're gonna have to call this um We're going to call this an unlock achievement as well Okay, and also probably in both. Okay. So now what we're doing in uh update row ui Um Okay, so we're gonna also create another yet another method Uh, let's just copy paste this Okay, so we're going to do updates specific row ui Cool, and this will take in a int id And now what we're going to do here Is uh rows dot or at index id Now the only thing we have is an image row. So we're going to set the color equal to Um, so let's see we have two colors here So right now it's sets like this color right here. So this is the same color is that we can see in Uh anti-matter dimensions. So i'm just gonna kind of copy all these float variables over into a notepad So I hate how the the panel just keeps closing every time I alt tab It's a very irritating how you can't just like copy and paste Or even just copy and paste as like a json string, you know where you can just like format it is like this Just a listed string. I guess I don't know. Anyways, we have our float variables here Uh, just ignore me For now, we're going to set the color to what we have here And remember we have to add the f prefix since there are floats And like this and I'm going to shorten these to about Yeah, that's honestly not going to do much. So I'm just going to shorten shorten it to two decimal places Because that's really not going to make that much of an impact Okay, so now we need to differentiate between the gray and the green. So when does this occur? Well, we needed to check to see if all achievements in a row one through eight are Um Are good to go. Okay. So basically what we're going to do in here is create a temporary variable called or just a temporary uh bool Okay, and we're just going to call this temp and we're going to set it to false Now obviously we could just set this to var, but I'm just I should really start using bool like instead of var More often so you guys can actually understand what the variable is even though like, I mean, you know what? It tells it tells me what it is here. It's fine But yeah, so we're going to create a temporary bool variable here And what we do here is we're going to grab a for loop in here. So var is equal to Uh Yeah, so we're going to set i is equal to id. So what is id here? So now remember Um row zero Has indexes one through eight right and row one has indexes nine through 16 Or actually well, it's technically zero through seven and then eight through 15, right? Am I right? I feel like it's not I think it's one I feel stupid help Yeah, that's right I had a brain fart for a second. So basically we need to just kind of check for this right here. Okay Now it's a little hard to kind of just convert one and two a's actually this might not be too bad So let's say i is equal to one. We want to start at eight So I think we just set i equal to um One No, that doesn't no it doesn't work like that I think we just set the set it's equal to Yeah, so we set it to id times eight. So that's the start right? That's the start Now what about the end the end is simply The end is equal to id times Eight because this is zero if it's zero. Yeah. Yeah, and then we add this by seven That sounds about right cool. So you just had just problems off. Okay, so we're gonna set the starting id times eight Okay, and we want to keep doing this until i is less than id minus Or id times eight plus seven Okay, and I don't believe we have to do any parentheses, but I'm just gonna double check Yeah, we don't have to And then we're just gonna add i by one Okay, so now we want to check to see if this achievement is good So we're gonna create um, actually no, we don't need to So a game dot data dot achievements unlocked at index i so We want to keep setting Okay, I'd say we just keep setting it's equal to whatever this is. Okay I feel like that's weird though I feel like there is a way you know what I have an idea. Well, let's get rid of this Right here and let's create an int counter, right? So we want to see if all eight of them are true, right? So what we're going to do here is that If uh, if this is true if this achievement's unlocked is true Then we're just going to add counter. Okay, and now we're going to do if counter is Greater is basically is equal then or equal to if counter is equal to eight question mark Then we're going to set the achievement row to on okay And uh, let's grab this background color here The ninth thing is that we could just do that And it looks like it's the same for all of them very nice. I like that Otherwise we're going to set the color equal to this number right here Okay, don't forget to add the f prefix Like that Okay, I'm just going to add the eight so we don't get any like fade Okay, so now let's actually move this into Uh, let's just um Yeah, let's do this we're going to create a private bull Okay, now because remember we need to eventually add this to our multiplier So I know there's a lot of stuff going on but remember this is very just convenient for us So it'll have to just like, you know, check to see if this row color is this, you know I'd rather just have a method Um row i'm just going to do is row completed Okay, and we're basically we're just going to take in another int id and we're going to do all of this here Okay, and we're basically just going to return counter Uh, if yeah, we're going to return if counter is equal to eight Simple enough, right? We're basically just moving this to a new method and instead replacing this counter equals eight If it's equal to eight and we're just going to just replace it with is row completed id Now this is a one line method The convenient thing here is that we can eventually loop through all of these is row completed uh, and then Add it or multiply it to our the this right here Okay, our row multiplier This is a lot going on. I know guys Hope you guys are hanging in there. Um, okay So now we're going to basically do the exact same thing in our private void update row ui And we basically just call this update specific row ui For rows dot count. Okay, so we're pretty much doing the exact same thing here Also, can I yeah never mind um Now we call this update row ui inside the star achievements I'm going to do it right after we call the update you achieve achievements ui Perfect. So I think we have everything done except for actually triggering the triggering the unlock achievements, right? So what I'm going to do here is we don't need this anymore. I'm just going to Make a new region down here And this is just ui related And I except for the except for one of them. That is the is row completed except for that because we're going to need that for later cool So now I can just hide the rest of the methods inside this ui related just like that and if you guys are still here Make sure you Have all of this code caught up okay and Let's start doing the Let's start doing the action Okay, so what we're going to do here is we basically just got to check through each achievement here So the first one should be very easy. It's my a single dimension for a single a single dimension, right? So I'm going to close this honestly. This is kind of actually not closing move it anyways um Okay, so what we want to do in here is we want to check to see if Now this is not going to be a very clean process. Okay. I'm going to be I'm just going to be real here This is not going to be a very clean process. We're basically just checking everything manually, right? We're going to set data equal to game.data here before we kind of not type game dots every time so if the data dots, um Dimensions so dimensions in an array. So we're going to do count So if dimensions count is greater than zero Then we simply have to unlock this achievement right here. Okay, and we set that to zero Pretty easy. Okay And we're not done here. The other thing we have to add is I only want to check this once Okay So because if we keep checking this over and over again, this unlock achievement is going to keep running this ui And it's just going to be annoying and it's going to look funky and it'll also use some cpu So the nice thing about um, oh, yeah, so what we can do here Um is add this data dot achievement unlocked at index zero So if it's false, we haven't unlocked it yet, so then we can call this now What's the issue here is that this is an array and we need to call the the At index zero. Okay, so that's pretty self-explanatory. So basically if our first dimensions It's greater than zero and we haven't unlocked this achievement yet. We're gonna unlock it. Okay Now We can for loop this we can honestly for loop through this first row. Okay Just to save up some time because honestly We're gonna be like doing one two three, you know, we can for loop only through this first row Okay, well, I'm just gonna throw it out there So far like we equal the i is equal to zero and i is less than eight Uh, and then we're basically just going to run through this if statements And replace the zero with i i and i and we're already done with the first eight achievements. Okay So now we got to go back to the second row Okay, so let's see. What is this one to infinity? We're not going to get this one, right? And also this hasn't a reward too So we can have to we're out to manage some of the boards and I don't believe any of these have rewards other than The achievement multiplier. Yeah, that's correct Okay, so the first one's infinity and that is pretty easy. You just set f data antimatter is greater than or equal then uh double dot max value and achievement Eight because remember we're doing zero index. So this is zero and this is eight and this is seven right here So if we haven't locked it then we're gonna unlock achievement number eight Okay, so now this one is the float Okay, so we're gonna replace this one with a float dot max value pretty easy And we just change the number here You can kind of see how to copy and paste this for most of them Okay, have exactly 99 eighth dimensions. Okay So copy and paste this replace the id with 10 And this is asking for eighth dimensions Right. Yeah. So this is dimensions count right here And Uh, we're gonna replace this with a seven right here And if it's greater than or equal then we can basically just greater than or equal than 99. Okay You guys see the pattern here, I hope so what I'm gonna do is I'm gonna skip along So you guys don't have to hear me talk and I'm just gonna do all the achievements and I'll come back to you after that Okay, I am back that was pretty pretty easy and I don't really have to explain. I mean, I guess I can so basically this is the actually I think I already did that one This one is uh, if antimatter dimension or antimatter is greater than 1 e 80 And that's a little achievement 11 dimension shifts is 10. That is uh, this one or dimension boost We have antimatter galaxies, which is that one Double galaxy and then buying a single first dimension When we have 1 e 51 50 of them. So how do we calculate that? So basically what we do is that we check the count for if it's greater than uh, or greater than or equal than 1 e 50 150 And We check to see if that dimension level level not count. Okay Is greater than zero because we want to buy a single dimension, right? Not 10 because that's just not going to count because this is by a single first dimension. Okay So again, also, uh, sure. I wasn't showing this so The one thing I also got to do and I got to learn is pop-ups or hover over or whatever these are called I haven't learned how to do these so i'm not going to implement these in this video Maybe I will eventually and i'm honestly going to have to I'll probably have like a boxer here or something. I don't know But i'm eventually going to have to learn how to do this because nobody's going to know what this is All right. Okay. So we have our uh, achievements done. Let's give them a shot Oh, yeah, we also want to add this start achievements into our game controller So let's go back to our game controller script. So what's wrong here? Okay, nothing Thanks for the false error Um, so yeah, let's go back here In after start we can do uh, we also need to add our achievements here public achievements achievements Okay What's wrong? Oh achievement manager got it And uh, achievements dot start achievements got it And we can honestly just do update here Okay, I think things are looking pretty good So I am expecting some bugs, but I'm also at the same time really confident Okay, so we have our game here done. Oh, right. Yeah And in our game manager, we want to drag in the achievement controller And I think we are good here. I am not sure what's going to happen with achievement names. Let's see what happens there It's supposed to auto initialize, but let's just see Okay, it doesn't so that's great. So that means using a list was completely useless So what we can do here is just take this in the start method Unbelievable You let me down unity So then at the top of the start you can just simply add Achievement names is a new list and then all your strings here Really inconvenient, but it's okay. It'll work regardless of Whether we have that or in a separate method And we're actually got to deal with it Okay, so we're saying we're already getting some errors. We have some null reference Actually, let's check this out. Let's see. What's wrong. I have a I have a Okay, so we have all of our let's see what's going on here That's going on So it seems like it's the It's got to be this. Yeah. Yeah, I see It's this right here, okay It's this data achievement lock unlocks. The reason why it's doing this is because it's still technically not initialized Which is an issue Okay It's frustrating. Okay. So now what we simply got to do Huh, this is the annoying part What we're gonna do Is try catch. Okay. Now. I can't really think of another way of doing this other than Searching see if it's null but I'd rather not do that So what we're gonna do is just set a random temporary variable that we're never going to use To data Dot achievement unlocks now this might be bad practice. I have no idea if there's a better way There is let me know in the comments below But basically we're just going to set this variable to temp and we're never going to use it, right? I don't want to print anything because that will I don't want anything to build up in the logs But we're going to set this variable to temp and it will generate an error and then we're going to catch that and what we do here is we set um our achievement unlocks like so And also you see we have this create list here what we can do here is type data with a capital Oh, wait, is this private? Uh, you know, I want to make this public Okay So then you do capital data, uh, create list bull and your size 16 here, okay And honestly, this will just always updates, but it's just to initialize the list with some data Okay, so now this shouldn't be an issue crossing our fingers So save and play Cool So we got to start somewhere. We already have our first achievement done Yep, everything looks good Let's see. So 100 anti-matter is a lot. Let's just keep buying these. Oh, yeah, we got to do the navigation first Okay, so one more thing before we do this is I'm going to create a new empty object called navigation Actually, you know what? We can do this in our, uh, games management or game controller because really there isn't much in here So in here we have, uh, we need two screens So we want to We want to, uh, add we want to make these Here, let me turn that off Okay, so basically what we haven't done yet is Add our canvases to dimensions and achievements. So what to do Or how to do that is type in graph or something like that and get graphic ray caster and it'll automatically set up your canvas Just fine. Okay Just like this and these are the exact settings. So you don't touch them at all Okay, so now in our script and our game controller, we're going to add two canvases one for the dimensions canvas And the second one for our achievements canvas. Wow, I cannot type. I deeply apologize Okay, so now what we do here is create a navigation system here public void, uh, navigate And we have to have our custom string in here And the string location will be in here and in here at the top. We're just going to set them both the false Okay, so game object dot set active false. Okay, we do the exact same thing for the achievements Okay And now under that we create a switch case for our, uh, location And our first one's going to be dimensions, right? So dimensions Okay, and that's pretty self-explanatory. We set the dimension canvas to true And don't forget the break Okay, and we're going to do the exact same thing for our achievements. So make sure you replace the correct stuff Okay, it's cool. We have our navigation system done pretty easy, right? And also another thing is that some of this UI, we actually don't need to update Um, let's see. Let's go to our dimensions right here Right here So we got tons of stuff in here. I like how I forgot Do you see all this dimension shifts all this crap down here? Okay. Do you see that? Well, we pretty much don't have to run all this. Okay. This is all user interface except for this dimension this right here, right? We can honestly just get rid of this move it to the top Okay I probably should move this dimension shift boost. I'm curious. What is this? All right. Okay, cool Yep Okay, so This is all user interface correct dimensions unlocked. We kind of want that at the top too Oh, yeah, and this dimension count obviously we want that at the top above all the user interface So now why did we move all that? Well, we want to move this all into a An if statements, right? So we only want to update this UI if game dot um Let's see Dimensions can this dot game object dots active self Okay, now we don't need to do this for achievements because we don't have a constantly updating UI So it's not nothing we need to worry about After that, we move all of this back to our back to this if statements Cool, beautiful Okay, that's what ours looks like Okay, and now we can finally apply our navigate methods Uh, click the plus sign on both of the buttons drag script or wherever game controller is and now for each button I'm going to add. Oh, yeah. I want to add navigate to both buttons Okay, now for the dimensions the string that we put in the parameter or the arguments is dimensions and The argument for this one is achievements. Okay We're basically just trying to identify which button we're trying or which one we're trying to toggle So back to our game controller. We need to drag our Dimensions canvas and our achievements canvas. Okay, cool. Everything should work as planned Sweets we now switch between so let's get our first uh second dimension and we have a new achievement So now let's just casually keep playing the game. Okay So let's just keep playing and actually I'm a little impatient. So I want to see what this row does, right? So one, two, three, four. Yeah, okay. I'm just making sure I've been really like procrastinating working on the achievements because I was just like, and I don't really feel like it Okay, so we have floating antimatter. That's good Cool. Alrighty, we're almost there Yeah, we're seeing we're getting a bunch of these achievements now something that we shouldn't even be getting now It's okay I just want to see this achievement in action Okay, one more And we should have a row complete Ah, we don't have a row complete. That's a bummer I think the reason why it's not working and if I save the game and close it'll work just fine. Let's see Let's see if the achievement saved in the first place Cool. Okay, so now the issues that our rows are not updating Damn So let's go to our achievement manager and let's figure this out. So let's see Um So update row ui occurs at start Okay Rows count Let's see is completed. I feel like it's something wrong with our is Completed. Okay. I feel like it's something wrong with that so our Hmm Okay, I see the issue here. It's this right here. Okay. It's the less than we want to set that to i less than or equal then unless we just want to add a plus eight here, but I'd rather just do um Less than or equal then just because it kind of like makes sense on how we're viewing it here So just change the symbol right here to a less than equal then rather than just a less than and everything should be beautiful Sexy ready to go Alrighty, I'm hyped. Let's go Also, I just want to say the next video will be infinity. Can't wait for that Yes Okay, cool. So we have this done. However, we um We still got to do this boost. Okay, so let's just let's just get that done enough with it won't take that long Okay, it's just take some passion Or discipline. Okay Um, okay, so we're gonna add tm pro to our achievement manager as well Uh, we're gonna add another tmp text called achievement boost Text and we also want to yeah, that should be fine And we're gonna add a method up here called public big double Uh achievement boost Okay And basically we're just gonna add a temporary counter again And we are going to make a for loop var i equals zero and i is less than rows dot count. Okay Cool And basically what we check here is if is row completed at index i or The argument is i also if you guys are confused with argument parameter is This is the parameter right here, right the intake whatever it's trying to take in right That's the parameter the argument is whatever we're trying to put in. So this is the argument right here This is the parameter. So just just to clarify Um, so if the row is completed that we're just going to simply add to our counter Okay, and let's actually do Uh achievements Completed okay, and then we're gonna have another big double up here public big double achievement boost and that is going to be equal to big double Uh pow 1.5 and I guess I guess each row is 1.5 times. That's my guess It's 1.5 times uh 1.5 to the power of achievements completed Cool Easy and then here we return the counter Okay, so now let's get this text here Set it in our update and actually this is one of those things that we're only going to update every frame So just for cpu purposes, we're going to do if game dot navigation Uh, where is the canvas Right here achievements canvas dot uh active self. Oh, yeah, it's game object dot active self Then we're going to set the text equal to Uh, whatever we have here and I'm just going to jot that down real quick. So current achievements multiplier On each dimension. I know I can't you can't see it one second Okay So a current achievement multiplier on each dimension And we want to add that dollar sign so we can put variables in the middle of a string And that is the boost. So let's do Uh, yeah, so boost dot psi Right here Now the reason why we do dot psi is because we are trying to do the scientific notation and we add our use our Extendables right here our extendables namespace and we can use dot psi Okay And that will be just the next right here Beautiful and also I think we just want to show one decimal. So let's just do one Right here. I think that's correct Okay, so now we actually need to use this boost too. So each dimension will have a dimension shift boost right here Okay, so this temp boost. I believe we just multiply it by the temp boost right here Oh, yeah, so that's the power of this. Yeah, cool And then we multiply this by let's see actually This dimension boost right here Uh Yeah, I think I'm just going to multiply the dimension boost by uh the achievement boost right here and you simply just do Uh Game dot achievements. I really don't feel like adding it to the script because we're only going to be using it once So do game dot achievements dot achievement boost times the rest of whatever it was in dimension boost Okay Cool. So now it should have an effect And it should show up as 1.5 times Oh, it's going to give us an old reference Hold up Okay, we got we forgot to drag this text in here this achievement mold. So drag this tmp text in here Okay And then we are going to See if that works. Yeah, there we go Now the test to see if it actually works. We can just simply change this and it'll never change, right? You can change it here, right? It'll change until we go back to 1.5 times because that's the correct boost Now we can just keep going but I really don't want to I kind of just want to end this video Because I don't want because I know you guys are probably getting bored of me talking for so long So anyways, if you enjoyed this video if you learned something new make sure you smash the like button Subscribe to my channel for new and turn all those notifications for future videos. We're so close to 2000 I also just want to say crypto grounds merch is coming soon. I'm planning on releasing it 2500 subscribers. Maybe sooner. Okay, so Keep update if you're interested for that. Also, please give smash the like button Give me all the support you can help me revive my channel every single like and comment helps This this video grow so it means the entire universe to me if you guys do that Anyways, I'll see you guys in the next one. Peace