Hey everyone in this series of videos we are going to take a look at blueprints scripting in Unreal Engine. And we're going to start this off with a quick overview of what blueprint scripting is. So what is blueprint scripting? Well, it is unreal node based visual interface for creating gameplay elements. So it's a way for non coders such as myself to program functionality into a game, which is pretty awesome. So to demonstrate what this looks like, I am going to open up our third person Character Blueprint right here.
So I've created this project right here using the third person template. And with that comes this third person character and how I got to them is this breadcrumb of folders here content folder, third person BP blueprints and within this folders, your third person can If I double click on him, I will be presented with a whole bunch of nodes on something called the Event Graph up here. So all these nodes are linked together with some wires. And this is blueprint script that is determining how this character moves. Alright, I'm going to close out of this real quick. And I'm going to jump over to something called the level blueprints.
So right here, I click this blueprints button, open Level Blueprint. And when I do, you're going to see some stuff that I have prepared ahead of time. And this is going to give me a chance to show off some things about blueprint scripting and give you a quick demonstration as to how this works. Okay, to start off here, with any bit of script that you create, you need an event node. Event nodes are listed in red, and you've got events for different types of things. You've got any For beginning play, and this happens when you simply press play to start your game, you've got an event for Event Tick, this fires off every frame.
So if your game is running at 60 frames per second, this is going to fire off 60 times in one second. You've also got events for stuff such as key presses. So in this case, press pressing h on my keyboard. So any bit of script is going to start with any event. When any event happens, that is going to send a signal out of this out execution pin. And he is going to plug into some function node to make something happen.
So what is a function? Well, for starters, here functions have this sort of blueish header here. And a function simply makes something happen there functions for all kinds of things. This particular function will play a sound a 2d set Meaning it's not localized in 3d space at all. Please scroll down right here, there is a function here for printing a string. That's a fancy way of saying it's going to print out some text.
In this case, the word hello to the screen. We've also got a function for something called spawning an emitter at location, which you can think of this as spawning a particle effect at whatever location we tell it to spawn it. So I'm going to give a quick demonstration here. As to how this works. The easiest demonstration I can think of is to use an Event Begin Play. So this is going to fire off the moment we hit this play button up here.
And what it's going to do is it's going to send a signal out of this out pin down this wire. And I'm going to plug this into our place down to the node. So this is going to send a signal to play a sound, what sound in this case, I clicked on this little drop down arrow right here, and I Found some starter music that was included with the Starter Content. So that's the sound I'm going to play as soon as I click play here. So, to demonstrate this just going to jump in and play. press escape here and see you heard some music playing there.
Now you'll notice on the left side of these function nodes here, there are a lot of different colored pins. These round things here called pins, even this appear is called a pin. These triangle shaped pins are called execution pins. This is this is what keeps the flow of execution going. So if we wanted to, we could actually continue this flow of execution to not only play a sound, but to have something else happen right after it. These pins down here are known as data pins in because these are on the left hand side of the node.
These are input data pins. You You can input some data into this particular function. For example, we've got a volume multiplier parameter right here and set to 1.00000. So this is going to play the volume at a usual level 100%, right. But we can plug in a variable. A variable is something that holds information into this function to determine how loud or quiet that should be.
So, over on the left hand side here, I have these things that are called variables. And variables are what you can think of is like Tupperware containers that store some sort of information. So in this case, you'll notice that I've got all these different variables and they all come in different colors. And over here, on the left hand side of this node, you've got all these different pins and they come in different colors. In this case, we will have a volume multiplier that's kind of this lime green. It is looking for what is known as a float variable.
And I'm just going to go ahead and plug in this float variable that I've created ahead of time into this volume multiplier. Now right now the value of my float that I'm putting in right here is 000. So if I was to actually play this now, my volume would be zeroed out. So here we go. You don't actually hear any sound now because the input that I'm putting into this, my float is zeroed out. However, if I change the value that is stored within this variable to something like two, and now click play.
You can hear my music playing even louder than before. So that's it. Real quick primer here is to what scripting is one more thing I want to show you. Before we leave off here. I'm going to break off this tab here. I'm going to try to do kind of a picture in picture here.
To demonstrate this flow of execution that happens when any event happens. Notice what happens here along this wire as soon as I hit play. Again, in case you miss it, look again at this wire one more time. You can see that there's a visual demonstration that an event happens and it's sending a signal to this function to play some music. All right, I hope that gives you a brief overview of what scripting is and how it works within Unreal Engine. We're going to dig a little bit more into this in the following videos.
We will see you guys there.