 Hello guys crypto grounds here welcome back to another unity anti-matter dimension video this episode 9 and today We're gonna be doing break infinity. It's gonna be an awesome video If you enjoy this video if you learn something new make sure you smash that like button Subscribe my channel for new and trust notification for future live streams and video and don't forget don't forget Be sure to watch to the end, okay? watch oh Okay happened a little sooner than I was expecting but yeah anyways make sure you watch the entire video It really helps grow the channel and comment all that good stuff, okay? Anyways today, we're gonna be doing infinity. So that is the big crunch here, okay? So if you don't know that occurs when we have e3o8 anti-matter well specifically 1.7 9 e3o8 anti-matter, okay? So Yeah, we have our big crunch here. I'm not gonna do anything yet because we're just kind of kind of get stuff I Guess stuff started, okay, so yeah, let's do that So what I'm gonna do is that pretty much this entire screen is just gone, right? so We can simply just wipe this canvas, but that'll kind of be a little weird But so I'm gonna do instead. I'm just gonna create an empty An empty game object here and that's gonna be called just the big or Non Big crunch, I guess we'll just call it Okay, we're gonna make it stretch for the entire canvas once I zoom out So zero zero zero zero, okay, and then we're just gonna throw everything inside Okay, so now we could just toggle this and we'll do as we please and Now what we're gonna do is add another game object. We're gonna stretch it to to our entire canvas as usual And now we're just gonna add another button. So I'm just gonna copy and paste this dimension button here and Yeah, we're gonna just do that big crunch. Okay And now let's turn that off and we have our Big button here and that will say big crunch. Okay Now I think I'm gonna add another text that says how much you get because this is kind of vague I don't know. We'll see Maybe we got a sick to aesthetic. So maybe we'll just keep like this Okay, that looks good though. This but this image border is kind of awkward in my opinion Yeah, I like that big crunch, I like that and Then we need to add one more text as well and that's just like this right here and The world has collapsed itself due to the excess of antimatter Cool, cool, cool. We're done and I'm just gonna bring that to the middle. Okay, and that's all we need to do We can also add the little animation here and this is what it looks like It's just a screen that like comes in and out. Okay, we can try that animation too We'll try it Okay, so let's start with this big crunch animation, okay So what we're gonna do is go to our animation tab. It should be open If it's not you could just do click on the three dots here at the top and then add animation Okay, and then you just click this create button here to create an animation. Let's create a new folder called Animations, man, that's terrible Okay, and I'm gonna call this big crunch Okay, big crunch out Okay, so now what we do here is Simply just record this and then this is honestly just going from scale like one To zero, okay It's basically just doing that. Okay. It's very easy to animate. I Couldn't record how fast that was. I'm guessing it was like a second Yeah, pretty easy honestly, and then we're gonna make another animation for our non big crunch screen and Basically, these will both play at the exact same time So I'm gonna create another animation and this one's gonna be called big crunch in. Okay, and It's the same thing where we Set this to zero at the start After one seconds, we're gonna also set it to We're gonna set it to one for now. Okay, you'll see what I'm doing here. We're gonna add another value for one I'm just gonna like change all this stuff eventually. Okay, so this will become one and then this will be zero Okay, so basically at it's staying in zero for seconds, and then it'll after once I get will come back Like that. Okay, and also what we want to do is go to our animations folder Oh Here's big crunch. I was wondering where that went move these to that folder So click on big crunch and big crunch out Yeah in and out. Okay, so make sure you toggle off the loop time Okay, and also before we forget. Let's set this update mode to unscaled time Okay, so no matter what our game speed is we can it'll just it'll just be at the same speed, right? It was two times game speed then the animation would perform two times faster. Okay, pretty easy pretty easy And honestly we can start a new script here We're just gonna call this infinity infinity manager. Okay, we're not gonna do much today. We're just gonna really get started with What we unlock here like the infinity tab we're not probably not gonna do many of the upgrades I might be it next up. So I kind of want this to be a sweet and short some simple video. Okay Seltzer alright, so now we're gonna add a new script called infinity manager cool cool cool Also, I've been doing a terrible job moving my scripts to the The scripts folder, so I'm gonna do that real quick once this file is created. There we go I'm just gonna move that to our scripts folder because it kind of gotta get organized, you know Also one thing I want to teach you guys never move a folder inside writer or an IDE Okay, it'll just completely screw up your entire script and everything so make sure you just do it inside unity Oh, this is compact. Oh, yeah a new window forgot that I had that open Okay, so now we're in our script called infinity manager. We're basically I have two animators, okay, and The first one is gonna be crunch in and the second one will be crunch out Okay, and I think it's out of Using the engine dot UI. We will have to at some point and also we're gonna need TM pro Okay, well looks like these are unity engine. Okay. Good. It makes sense So now what we're gonna do here is we're going to perform. We're not gonna do any resetting, you know We're just gonna do We're just gonna perform a big crunch here. Okay, we're not gonna do any resetting. We're just gonna do the animation stuff Okay, so then in here all you got to do is do crunch in And crunch out so crunch out is the one where it goes out. Okay, so you want to play the crunch out first So crunch out stop play And what a renamed it and it's it should be just big crunch I think it's just big crunch in our big crunch out. Yeah And the state name is big crunch out which put zero and zero for a layer in for our normalized time And for big crunch in it's the crunch in it's the same thing that's called a big crunch in Okay, so now once we call this button here everything should run Hmm However, we're missing something. We don't know when this big crunch is actually going to appear So we need to do that. So how do we do that? Well in our data here, actually, we could just create an image here Because that's what it is actually yeah, no, it's a Uh, yeah, it's just okay I see now In our game controller is what we perform this. Okay, so we're gonna have to Uh, game objects Actually really this should be can they should be canvases Yeah, we're gonna make these canvases. Okay, so we're gonna have two canvases in our game controller Our first one's gonna be called the non big crunch And the second one's gonna be called a big crunch. Okay Alrighty and now this will show up when we do this. Okay Also before we for actually no, we're gonna get to that eventually. Okay So in our update method if uh data.antime uh, yeah data.antimatter is greater than or equal than Um What was I gonna do? Yeah double dot max. We're basically not gonna do like the infinite infinity thing. Okay Actually, yeah, we are never mind ignore what I'm saying Oh, yeah, so we're gonna do this Okay, so if antimatter is greater than or equal than uh Double dot max value. We're gonna do a question mark operator instead. Okay, or not a question mark operator. So we're just gonna do dot non big crunch dot game object dot set active to Uh, we want to set this to false, right? So if as long as it's not greater than or equal then, okay So you can just simply just do less than So if data.antimatter is less than double dot max value. Okay And eventually once we break infinity we'll we'll get rid we'll fix this. Okay Now the same thing for uh Big crunch except the opposite. We want to do it if antimatter is greater than or equal than double dot max value Okay, and then we'll just show that pop up Awesome, I think that's it Okay, so now we're gonna go to our game script here And simply add the non big crunch canvas and the big crunch canvas and then we're gonna go to our infinity manager And drag in the non big crunch Animator which is crunch in and big crunch which is crunch out Okay, and also we need to add a button component or yeah We just need to drag this infinity manager into our button component for the dimensions button Actually, we're gonna rename this to the big crunch button big crunch button Okay, and now we're gonna replace this function or the method with big crunch I still hate how this is function because it's really a method Oh Where'd it go? Oh Issue. Yeah, I forgot about this when we go to our animator tab here again three dots add tab Uh, oh, yeah, we gotta actually do a window animation Animator, okay. Now the issue here is that on start it's going to call this big crunch in right? So how to fix this we're going to create an empty state. So you do right click create state empty Okay, so it's just doing nothing and then we're going to right click that And we're going to do a set layer as default state. So then now we don't have to worry about that Do the same thing with um for both. Okay Cool We're good. Okay. Save actually doesn't need to save because it's I don't know just doesn't need to Uh, now we can run and we should be good. So let's see how many let's see Yeah, it looks like we have Oh, we have lots of anti-matter. We have 637 thousand Irmint. What was that? What the fuck did I just say? E 638 I don't even know what I just said guys. Okay. So now let's just try this out. So at least know that it works. Okay Okay, let's try it. It's inactive I see I see Okay Issue number one It's this right here. This is an issue right here. Okay I think I should do a canvas group for this one Um, I think that's the only solution. All right, just what I said before we're going to get rid of both of these canvas and the graphic recaster I should delete great graphic recaster first and then canvas and then add a canvas group Okay, I don't really like using canvas groups, but this is my only solution for now Uh, let's see And in here, I'm just going to add another method called public void canvas group Change Okay, and in here it's just going to be a bull and uh And we're also going to take in a canvas group. Okay Okay, so now what we're going to do in here is we're going to do canvas or we're going to do group dot alpha Is equal to statement question mark one or zero. Okay, and now this is the same thing except for um group dot block raycast Is is also equal to group dot Interactable, okay, and that's going to be equal to statements. That's pretty much it. So that's canvas group change So now we're just going to be toggling our canvas group instead of doing this right here Okay, so that means we're going to replace these two canvases here with canvas group Okay, and Okay, so you see non big crunch. Okay. Yeah, so we're going to replace all of this with canvas group change our statement right here and then our um Non big crunch canvas group right here. Okay, we're going to do the exact same thing for the big crunch right here And everything should be lovely now The only issue here is that we're not resetting our We're not resetting our um our anti-matter Okay, so that's an issue because it's just going to like keep it's just going to stay on forever And this will always stay off. Oh, yeah, right. Don't forget to redrag your canvas groups Okay, let's try this out. I know it's not going to work for a fact. Yeah Yep Oh, wait a minute. Yeah, we gotta turn this on Okay So I just turned the big crunch uh on and I set the canvas group to one and then turn these two on Now if we play this it should work and except we're not going to see our Um, we're not going to see this one here. Okay, and this is going to be gone now I don't know where it went. I think it's yeah, okay What we got to do here is set this back to one once we're done It's like right the next that the next frame We're going to turn this back to one right Oh my gosh, this is a little yeah a little messy. I know Okay, so this is going to become a mess. Okay. This is a lot of troubleshooting here So I think what I'm going to do is that since I know this is a one second animation I'm going to call um I'm going to call another method. Okay, but we're going to do it after one second. Okay, so big void, uh, our public void big crunch reset, okay And we're basically I guess we're just gonna have to reset everything and I should probably do that anyways And what we do here is uh Something called invoke. Okay, so we do invoke our method name And the time so once one seconds fine Oh, sorry Let's see. What's wrong with this Argument type method. Oh, I see we have to make this a string Okay, so public crunch reset. I think we can just do name of yeah, that's fine Okay, so invoke name of big crunch reset and our time is set to one f. Okay So I'll call this method after a second, which is just fine Um, okay, so let's do all of our resetting So basically, I'm just going to go to our data and just copy all of this Oh, we also want to create a another variable or click called public big double infinity points Okay And we're going to set that to zero in our data Yeah, I'll synchronize this at the end. Okay. Yeah. Okay. I see now So we're going to add a game controller to this game and then do game dot data dot infinity points Plus one we're just going to do plus equals one. Okay. We're obviously this is there's a lot more that's going to happen in the future And okay, so we're going to create a temporary variable called data or set that equal to gain dot data And we're going to add data dots at the beginning of all of these Oh And just delete these ignore ignore what I just did Um, okay, so let's see Achievement unlocks we can keep that stays Um dimension counts all that goes Levels shift boosts pretty much everything in here goes Yeah Cool. So we're basically just resetting all of these and then adding an infinity points at the end Okay, so let's give that a shot Since now we have a little more Um going on we actually have we actually have to reset too So big crunch Oh, that didn't like us What did we do wrong? Oh, we forgot to add our game Okay, let's see Big crunch Yay, it worked. So now let's see what happens if we get back to our one eighth Our correct amount of yeah, there we go. Cool I love that So let's see. I want to see it again. I want to see it again in here Should we do a comparison a side-by-side comparison? This is too big. Oh max mine's on play. I should probably do that Okay Okay, let's do side by side Oh man, hold on One second Okay, ready three two one go Yay It looks correct exactly correct. Okay So, uh, let's see. I'm just gonna add a few more user interface options And then I'm just gonna call it at the end of the day for for this video Um, really it's just a white. I don't even know how many get that white button I might have to design a new button real quick. Let's see. What is this like? Plus 15 I think it's plus 10. Okay And this is just an orange button Like that Now I need to get that white. Okay, so let's see. Let's see. Um button Is this still in photoshop? I hope it is. Oh, yeah, it is. Okay So while we're waiting for that, let's just change our labels to infinity I don't like how that's being positioned. It looks very weird infinity button Okay And now I'm just gonna copy actually I should just copy and paste this button. Let's see show and explore Oh, man, I didn't want to do that white button. Cool And basically here The thing that's a little tricky here is that we gotta kind of change this color So I think we just got to do this like on our own. That's fine It's no big deal. I'm just gonna have to copy this color There we go. We have our infinity button. That's the thing that just kind of sucks about doing this So I'm just gonna keep it as white for now because I kind of just don't want to make another button Uh, but I'm still gonna have to do this, right? Yeah So remember whenever you create a new button like this, you have to go into the sprite editor and if you want to use Slicing you have to uh divide up your image like that And I'm still getting weird results. Why am I that doesn't look right at all. Why does it look so? Yeah, oh, I see why I was like, why does it look so bad? It's because of this is orange Make this black Yay, we have infinity It honestly looks a little Too thin actually, you know, it's okay. It's okay What if we made these a little? I like that. That looks much better Ah, now I got to position all of these So what I do here is um It's I made all these buttons a width of one three three hundred Negative one fifty minus seventy five minus seventy five minus fifteen Let's see. What is this? Oh, that's pretty easy pretty easy if you ask me Okay, cool. We have our infinity awesome Okay, I'm not really sure what else I can do right now Okay, so let's see what happens when we go to the infinity tab we see everything but Um, so it's pretty much just like going to the achievements, right? We're basically just creating a brand new tab. We also unlock this text right here Okay, so let's just add that real quick. Oh man, that's really wide. Why is it so wide are all of them like that? I don't remember making them that wide Uh looks bad Okay, that's fine with me Uh, okay And here we have our infinity points pretty Nice The thing I don't know how to do is is a glow. Okay. I really I don't know how to add a glow inside a text I don't believe it's possible for what for what I'm doing Or for the text I'm using so I'm just going to simply do you have zero infinity points Okay, so I'm going to add like a yellow instead This is an interglow. I totally forgot this was an integral. I thought it was an outer And then since we have rich text on we can do color equals hashtag of that And yeah, that's the only unfortunate thing. I really don't know how to do is that And also I really despise text much pro When it comes to glow it looks terrible Why is it overflowing? I want it to wrap Okay Okay, that looks no, I don't like that really Wait, is that actually what that's for? Oh, that's so cool. However, I don't like how it really just Overlaps it. Let's see Okay, I see now You have zero infinity points and honestly looks okay I would still wish I could have this glow. I don't know. I like that. It looks nice I don't really know how to add a glow actually. Let's see. Is there a thing TM pro In text glow I doubt it. I really doubt it It's text with glow effect Oh, wait a minute. Yeah I don't really think so Because the thing I don't like about it is that it's material based So when you change the text the out the glow it changes all of them Like I don't I absolutely hate that you can see how the glow is being changed on all of them, right? I hate that It looks terrible I don't know why it does that too. That looks really weird Yeah, I honestly There's a lot of things I do not like about TM pro. There's also a lot of things that I do like about it. You can't get that mix Okay Okay, everything looks good All right, so now let's create this infinity tab real quick. So we have our achievement screen here So I'm just gonna copy that I'm just gonna copy that and use this as the infinity screen. Okay Get rid of that Get rid of all these achievements because we don't need them And here this is where um our you have this many infinity points will be displayed um Yeah, see it's material. It's really stupid You have zero infinity points. So we have uh lots of tabs here. We also have auto buyers too So this is going to take a really long time to honestly do Because I I still got to figure out which upgrades are not limited obviously some some of them aren't some of them are But yeah, so We'll get to it I think I should do a prefab here as well and I might I'm not sure. Hey, let's see. Let's create this button system first real quick. Let's get that done enough with So dimension bun button bun. I don't even know why I said that And this will be our upgrade That looks bad. I don't know why that looks so bad Okay, that's fine um So we have our upgrades here. Why does it look so weird? I don't know why you can't really okay They look just weird to me Okay, so we're just gonna start with our upgrades and I think I'm gonna do a prefab for each of these upgrades So we have different colors here Uh, what what if you buy? Okay, so we have white Blacks we're gonna have to create some new buttons here Uh This is our white button here. Actually, this doesn't mean called the infinity button. So we'll just copy and paste each one So this is the infinity button. This is just gonna be a white button Okay, and this will have a a black inner glow again You know, this is just extra stuff that I'm doing You don't have to completely follow along when it comes to making the ui You could do however you'd like. Okay, and also I liked how I made this dimensions Uh thing right here. So I'm just gonna copy and paste this Except get rid of all the dimensions and all this stuff Because I already have it set up. I just need to lower it Okay, so now in here we can finally add our button. So this will just be the upgrade section. Yeah Public or right click ui image White button. Okay. We also need to do our slicing in the sprite editor in here. Oh looks like it's already done Wow, okay, that's weird. So I guess it just copy and pasted its own settings Interesting That is very weird. I did not know that Uh, okay So I'm gonna figure out Actually, let's figure out the settings first to I think that just looks kind of bad. I like the roundness Like that. Yeah, that looks good Okay, so we're gonna have our Four colors all set up. So this will not be a part of the prefab. So we have our white Uh, I'm just gonna copy and paste all these colors one two three Okay, we also have oh we have We also have red, right? What's that? Is this like What's the difference between this one and this one? I honestly don't know But we have five colors then we have the green Gray We also have this red. Let's see. I don't know how I'm gonna be able to select the purple I think what I can do is that Oh genius I am a genius Okay, we have that Okay, so here we have all of our upgrades. I sent it to someone else. Oops. I meant to set that to myself Okay, so here we have all of our colors. I'll delete these eventually, but they're just here for temporary Cool Um, okay So I'm gonna copy and paste this one upgrade here with this white one here And I think this is too big. This is personally too big So let's make this a 200 by that's way too small. That's like a joke I think I'm gonna do 300 by 150. That looks pretty. Yeah, that looks about right Um, and this is just gonna be called an infinity upgrade And we have a text inside Nope, it's a text mesh pro Thanks for pros Okay, and the same thing in here. We have a black text and we're just gonna like re-select this That's where you you've been able to Selects everything. Oh that actually worked. Is that what that is? Yeah, okay Uh, okay, that works too Currently 4.2 x Cost let's see. What is this one ip? We need to add some padding too Cool, I think we're looking good. I don't know why it does that rectangle thing. It's very weird Okay So we have our infinity upgrade. I'm just gonna add this as a prefab. Ah, no, no, no, no, no, no, no, no, no, no We must add our infinity upgrade Uh game object here Now I know that's just 16 or 17 technically Um objects, but I still want to kind of just, you know quality of life, right? So in here, we just have to add two things and we also have to add um using tm pro And using unity engine dot ui Okay Now in here, we're just going to add an image Uh, I don't know. Let's call just image and tmp text Yeah And this will just be called a description. I guess that's fine. Okay We're done with that. We just got to drag in our stuff now and then we can um start and again I'm getting really far ahead of myself. This is really supposed to be for next episode Okay, let's drag this into our prefab and then we're done Cool All right guys, we are done with uh our infinity. I know it wasn't much to do But we will start doing the upgrades in the next video episode 10 and that's a good timing because that's a great milestone Anyways, if you guys enjoyed this video and if you're still if you watch all the way through Thank you very much. I extremely appreciate support really helps the video grow and helps the uh the channel grow and it makes me happy And yeah, anyways, if you enjoyed this video make sure you smash the like button subscribe to my channel if you're new and turn on notifications for future videos and then Oh, yeah comment all your feedback Uh started discussion ask some questions all that good stuff. I'll be sure to check those out Anyway, see you guys in the next one. Peace