 Hey guys, CryptoGround here. Welcome back to another amazing Unity video. Today, we're going to be starting a new series revolving around Unity's Bolt for visual scripting. If you enjoyed this video, make sure you smash a like button, subscribe to my channel if you're new, turn on those notifications for future videos and live streams, and comment all your feedback, suggestions, questions, all that good stuff below. Anyways, let's get right into it. So if you haven't heard of Bolt, Bolt is basically visual scripting. It looks like this. It's very cool. And let me put a disclaimer right out there. I would definitely not suggest making a full-on game with Bolt. That's just my suggestion out there. The reason is because things can get messy really fast, especially as a beginner. Two, it's really inefficient. Three, it's really good for learning how the structure of code works, right? Visually. If you're a visual learner, then you're going to love this. And eventually you'll be able to transfer this into coding in C-sharp, because they work the exact same way. It's just visual, right? It's kind of like scratch in a way, but more interactive. So yeah, I would use this for educational purposes only. Do not use this to make full games, because programming is much faster. I think you can get things done much faster, and it's obviously better to code. Just because it's healthier practice, I guess we could say. So anyways, let's add Bolt to our Unity. I already have it installed, but basically you just go to the Asset Store, search online, and basically you'll pull up this right here. It looks like this. This is the home page, and you can search up Bolt. It'll be the first result called Bolt Visual Scripting, and it's by Unity Technologies. Then you can just open in Unity, open Editor. Let's do it. And then you'll pull up the Package Manager. Also, this is in Unity 2020, so it might be different for you. But if you're not using Unity 2020, I'd highly recommend you to update. And to see, yeah, a Bolt. So then what you do is download, hit Import, okay? Once you're done with that, you will see this install Bolt folder in your assets. Double-click on the Bolt1412net4, okay? And this basically will load up. There's nothing to import, but basically you'll get this Import Unity package, and then you'll have to go through an installation guide. And yeah, you go through whatever settings you'd like. So I have my scene set up. I decide to add an image background with an image component. And I'm going to add an empty game object. And in here, this will just be our main script. I'm not going to do anything too fancy now because, again, this is very complicated. And then after you've done it installed, you're going to add something called a Flow Machine. Flow Machine is basically your central script. So then you can get rid of these variables. Actually, no, just keep it there. Okay, so right now the source of this is a macro. So basically this is good for doing stuff on an object. However, we want to do embed because we want to be able to use external objects, such as being able to use this BG or whatever text we have in this canvas here. Macro is only good for if we have components in here that we want to use. So again, just switch to embed. Give it whatever title you want. It's just like a visual thing. So I'm just going to call this clicker or idle main or something like that. And this is the central access. Okay, something like that. It's cool how you can actually add descriptions. I like that. Anyways, so once we do that, we want to click on this Edit Graph button. And then we should see this window pop up called the Flow Graph. And we see our basic stuff, which is the start event and update method. Now, if you've done my Unity idle tutorial video or some Unity tutorial, you've probably seen the start and update before, right? It's the same two methods that you start with. So again, we're basically just saying the block view of our code. Okay, and also you see some of this stuff. You might not see it right away. Okay, and that might be because your window is too small. So I'd highly suggest making it bigger. Okay, and if you still don't see it, go to Window and click on Variables and Graph Inspector right here, and it should open up these two and you could just drag them to the top right here. Okay, alrighty. So we can ignore this start and we have our update right here. So I'm going to make an organization or like I'm going to organize my code real quick or my flow and I don't know what to call it. So you can add this right here by doing Control click and on Mac its command. So this basically makes a group, which is very nice. You can move stuff in and out. You can move stuff inside the group. Very nice. You can also expand the groups too. So it's very good for organization and it's very easy to modify. You can also change the title. I'm just going to call this the main. Okay, so now it does nothing, absolutely nothing. So we need to, let's create some stuff real quick. Okay, so we can just click out of that. So basically, let's add a text. Okay, and let's just make that bigger. Put it at the top. I'm going to anchor it to the top. Okay, I'm going to align it in the middle and we're just going to call this Coins. Okay, Coins zero. Actually, let's do dollars. Okay, dollars. Cool. So now here, now we have a text. Let's add a button as well. Okay, we're going to actually put this in here. And this will be our Coins text. Okay, now we're going to make a button. Go to just right click UI and button. Okay, I'm just going to call this the click button. So you see, if you've done my tutorial, this is pretty much almost a very similar process. Okay, and we're just going to do click plus click. I'm just going to call this click plus one dollar, right? Something generic. Okay, so now we have a click button and our click text. Okay, so now let's go back to our graph right here. We can just click edit graph anytime. We could also just like move this whole thing to the side if you don't want to see it, if you don't want to close it. Let me fix that. Okay, so now we need to update this text. Okay, so let's do that. So basically what you do is right click add unit. And now you have a lot of options here. Okay, since there's so many options, I think adding or searching is much easier. Okay, so we can add a text right here, right? So now we have tons of stuff we can do. So we have text dot get or text dot color. And also it really depends on how this might look different based on how you set up yours. I did programmers view. So basically it looks like this. So it looks like I'm actually like programming and so yeah. And here what's really cool is that you can actually set the color to your text and stuff. It's very nice. This I really don't know how to is equal to. Yeah, I don't know. I start to play with this stuff. It's very weird. And yeah, okay. So anyways, you can create tons of stuff in here. So if we do text dot text, we can access the task. We can read what it says. We can also set a text. Okay, so we want to do sets. Also, text mesh pro is text mesh, right? I think it's TMP text. Unless it's TMP text. No, it's text mesh. Okay, if you're using TMP pro, that's what you use, I think. Oh, we don't have text mesh pro. Okay, but yeah, that's what you do as well. But we're using Unity's normal UI. So we're just going to do that. So we want to do text dot text and we want to do get instead. Okay. Actually, no, we want to do set. Sorry. Okay, text dot text sets. We want to set. Oh, man, I am like struggling guys. We want to set. Okay, there we go. Okay, so now we have our text set object right here. So now it's got zero flows going in and out. Okay, so, but update has an outgoing flow. So we want to connect this flow to our in going flow in our text set. Okay, so now this is basically adding our text dot text is equal to in our update method in the code, right? Okay, so now we want to set it to something. Okay, I'm going to show you an example. Also, real quick, see how it says itself right now. When we run it, it's going to give us a null reference error. Okay. So we fix this by clicking this dot and we add our coins text, or you can just simply drag your coins text right here into that box. Okay, so it's a similar process as assigning a text to our script and inspector, right? Okay, so now we have this right here. We want to I'm going to I'm going to show you an example, right? Okay, so I'm going to type I'm going to do right click add unit string. Okay. And we can do string literal. Basically, this means we're just creating an empty string variable right here. And we can make this say something like hello world. Okay. And we grab this node right here and we connect it to the the parameter right here. So basically, this is our argument and this is our parameter. Okay, so we're setting our text to hello world. So now if we save this, I'm going to move this to the side. And if we play it, it should say hello world at the top. Cool. So it says hello world. Now the really cool thing is that it can show you what's going on. Okay. So all these little dots, it shows you where everything's going and it looks beautiful. Right. And also tells you the variable right here what it's currently being set up. So that's very nice. Okay. So let's actually make it do something. Okay. So I'm going to get rid of this. I'm just going to put this all over here. Okay. So I'm going to make another group called click. And I think that's too group. That's too big. I'm just going to make one click right here. Okay. So clicking a button, we don't have to assign our stuff to the actual bug component here anymore, which is also kind of nice. All we got to do here is search up on button click. Okay. On button click. All right. So now we have only one outgoing node right here. And basically we want this to add to a variable. We don't have any variables right now. Right. So let's add a variable. So right here in our variables right here, you can go to scene. You can also go to app too. Okay. So basically application variables are saved between different scenes. Scenes, scene variables are saved between for the scene only object variables are saved only for this object right here. So basically it's like having a it's basically like, again, if you followed my tutorial before my editorial video before, it's like accessing a variable from your player data class, your player data object. It's the same thing as this, right? And graph is a local variable in this right here in this system right here. Right. And also see it says across the current game object. Yeah. So see it gives you an example or it gives you a good explanation. So I already have a variable here. So I'm going to get rid of it because I was I was experimenting before this. Okay. So I'm going to add, I'm going to add an object variable called coins. Actually, we're just going to call this money. Okay. And you click that plus sign. And it doesn't have a type right now. So we I'm going to sign it a float. Now I don't know where double is. I'm going to be completely honest. I don't know where double is or decimal. All I know is that there's bull string and floats. You can't even do you int. Yeah. Or bytes. I don't think there's bytes. Yeah. There's only float. I don't know how to do some research on that, but we're just going to add a float for now. Okay. So now we have a variable and we need to access it. So I'm going to right click add unit and search up get variable. Okay. Also another way you can do this is drag this right here into the thing right here. Basically just click on this double line right here, hold it and you can drag it onto the graph. And there we go. You have a get variable here. Okay. So now we're creating an access point of this right here. And again, what's nice about the object is that you can access other objects right here. Right. So it's like accessing another a script or another class for their variables. It's very cool how they did this. And this is good to visually see how that works. Anyways, enough talk. So you see we have this get variable here. So let's assign it to this text. Obviously, we can just bring this into our parameter or parameter right here. And now whatever this value is, text is going to equal it. So ready. I'm going to show you. Let's go say zero. Oh, we have an error. Okay. So the issue here is that we need to convert it to string. It's the same issue that we have with the code. If we just set a string to a normal variable, then it's not going to work. So we add a float dot to string. Okay. And let's get rid of this right here by right clicking drag this node into the blue circle and drag this one into the orange one. And there you go. So now we convert this floats into a string and then we set that to the text. Okay. And now see it sets it to zero. And this also continuously runs. Okay. Very nice. So now we go to object and we can change this variable. So let's change to 10. You can see it changes with us. It's very nice. It's very quick as expected. Okay. That's pretty lame. We don't really do much, but we're going to keep this here because it'll be useful in the future. Okay. Actually, let's get rid of this. Never mind. Let's add another two string. And instead, we're going to add a float dot to string, but with the format. Okay. So you know that F2 thing where you want to see two decimals. That's exactly what this is for. So now the same thing you drag this into the green box now. And you drag this orange dot into another orange for a text. Okay. Oh, actually, no. Sorry. My apologies. This is only if you want to have format on. For example, if you have a bull, you can toggle this because this is you can toggle this, right? So let's do this. Let's say let's experiment so we can add a bull here. So we can drag that to here. Ah, shoot. That doesn't work. Oh, it's a string. Okay. I see now. This is starting to make sense. I'm kind of learning on the way too, but I see. Blue is a float, right? And orange is a string. So if you search up string, you get a bunch of orange circles, right? But if you search up float, you get blue. If you search up bull, you get pink, purple. Okay. So basically this is telling you what variable it's accepting at the moment. So obviously a text is a string. Okay. If they don't match, then we're going to have some issues. Okay. And I'm guessing green is any. What is green? I don't know, honestly. Okay. So anyways, we can drag this green into the blue. I'm guessing green means it can go into anything. I believe. Okay. So yeah, we're going to drag this green into the float property here. And we're going to set our format to F2. So now we could see two decimals. Okay. So let's give that a shot. So we should see two decimals now. Cool. It says 0.00. Perfect. So now let's learn how to add strings together. Okay. So let's add another unit. Let's call, let's make a new string. Okay. In here, we can add whatever prefix we want to. So I'm going to add a dollar sign. Okay. So this is going to go before the actual variables. Okay. So I can literally add this before. And you can just do it however you'd like. Actually, I might have it go right here. Again, it's organization. I have OCD. So you can do it however you'd like. And I'm going to add an add flow from in math slash generic. So basically we're going to add two variables together. So it takes in any variable and it combines it together, whatever matches. Okay. So we're basically going to, we're basically going to make a string out of this. And this should change to orange. That's my guess. Okay. So we're going to add the dollar sign at the beginning. So we put a, okay. So then we want to, we need to add B. So we need to add this get variable, which is very easy to do. We can add this, we can click, hold on this green node again and drag it to B. So we can create as many access points as possible. Okay. Which is very cool about that. And again, we do that in code too. Okay. So now we have this ad right here. We can now finally drag this into the two string. Right. So we can automatically gets rid of it because I can only accept one input. Okay. Cool, cool, cool. So now basically what it does is that it takes a string, which is the dollar sign. And then it also takes the very, the money variable, adds them together. And then we convert them that two string. And then we set it to the text. Okay. So now if we run this, it should have a dollar sign in it. Oh, we have an error cannot convert system string to system single. Okay. Oh yeah. Also the nice thing is that it gives a red, a red color back here. So right now it's, it's not going well right here. Okay. And I think the reason why, okay, I see what's going on here. Basically, it cannot convert a string in free format. Right. So basically, you see how this is an orange dot right here and it's accepting a blue. That's not correct. Okay. What's also, so what this orange dot here is for is literally if we make it do string here, a string literal and drag this into the orange node right here, we can put whatever we want to. Right. Let me put F3 in here. We can put F4. Right. We basically change this variable. This is a variable format. It's a variable or it's not a variable. It's a, it's a parameter. Okay. We're basically setting this parameter to F4 or F2 or F3, three. Yeah. Okay. So let's fix this. So basically we need to kind of fix our order here. We can get rid of that. Get rid of that. Okay. So now what the two string is trying to take is, is this right here. Okay. So let's get rid of all our connections. Let's kind of rethink this. So basically we're going to drag this money variable into the two string right here. Okay. That's it. I'm going to get some space because I'm going to show you what to do next or what you can do. And then we can also drag this right here into B. Okay. And then our dollar sign into A, just like that. And now we take our A plus B results into our parameter for the text. Okay. It looks very neat. I love how organized this is. It looks pretty. I love flow charts. They look so nice. Okay. Anyways, let's play it. Okay. And now we see we have the dollar sign and it looks like this. See how satisfying that is. So now what the cool thing is, is that we can add. Okay. I'm going to move that to the other side. That's what I did. Is that we can add a string variable and change this F2 if we wanted to. Right. So just watch this text change. It's going to be empty. Right. F0, 1, 2, 3, 4, 5, 6, 7, 70. Yeah. That doesn't work. But you get my point. Right. That's really nice is that we can literally change this whenever we want to. This is a variable. We can do so much with this. Okay. Also, the nice thing is that it shows your variable right here. What is equal to right now? F1. Okay. We're going to do F2. But anyways, my point is that we can eventually have settings if we wanted to. Like, oh, do we want it to be F2, F3, F4, et cetera. Right. We can do so much with this. And as much as we can do in code. But obviously it's a little slower and more problem solving. Okay. So now let's actually add to our money. Okay. So on click, we need to access this variable. Okay. Because we're going to try to add on. So what we're going to do is set variable. Okay. And now we're using an object variable. So we're going to do set object variable. Okay. Now, if you did a scene variable, you do set scene variable. And you can obviously change this in here. And we're going to click on this drop down and access money. Okay. So we're going to be setting this. Okay. And next, let's add a float. Okay. A float literal. And I'm going to move this down. Okay. So basically we can add, we can set this to zero right now. But obviously we're just going to be resetting it. We need to add on. So we're going to, what we can do here is click on this and hold it. We can let go of it. And we can, it'll automatically show the search option. So we can do add. And what's nice is that it gives us recommendations here. So it knows what it wants or what it can take. Right. So we're going to take in the ad. Okay. So we're basically adding two parameters in here. And now remember in code, we do plus equals. What's the equal that we're basically doing coins is equal to coins plus this variable right here. Right. So I'm going to set this float to one because we want to add by one. Okay. So now we want to add it to our current. So we want to do the plus equals here. And we grab this gets variable money and drag it in here. Okay. Obviously, if you don't want these things crossing over, you can just get to have another get variable in here and do the exact same thing. Completely up to you. Actually, you know, let's do that. Let's, we can duplicate this too. Okay. Okay. And then we can get this variable and drag it into B. Okay. So now nothing's happening because nothing's accessing it. After we add these together, we want to set this variable to what we have here. Okay. Now everything is still great out. That means it's not going to run at all. We have to add our flow node or flow out into our flow in and the set variable. So this is constantly running. So on click, it's going to add them together. Okay. Got it. Hopefully that makes sense. So this is what we got so far. Also, I'm going to call this the click group. Okay. So basically, this is kind of like a different, it's just a way to organize. It's like a region. If you know what a region is, it's like a region. Okay. So now when we click this button, it will do absolutely nothing. You know why? We never assign to this button. Okay. We have to drag, we have to drag this clip button into the self right here, into this right here. So now whenever we click this button, it will automatically do this. And now what's cool is that we don't have to do anything here. Okay. It will do that for us. Okay. So now if you click, it adds one and you could see how it triggers. Also, we don't do anything in the on click right here because of this unity message listener. That's what is going on here. So it's doing that work for us. Very nice. So now we make money and I think I'm going to end this video with that. Anyways, if you enjoyed this very interesting video, make sure you smash that like button. Subscribe to my channel if you're new and turn on notifications for future live streams in the video. Comment all your suggestions, questions, all that good stuff below. Every comment, like, subscribe. All that good stuff means a lot to me. Anyways, thank you guys for watching. Have a great day and night. Peace.