COMPLETE COURSE - Learn GODOT 4 in 90 MINUTES

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone and welcome to the course my name is Daniel Buckley and I'll be your instructor in this course we are going to be learning the Godot game engine okay Godot is a game engine that is rising rapidly in popularity as it is a very versatile platform in order to build 2D 3D games pretty much whatever sort of game you want to create you can do that with Godot and throughout this course we are going to be learning from the ground up how to go from having no knowledge whatsoever to creating your first ever game now Godot is a free to use and open source engine which has been around for quite a while now and as the years go on they are adding ever more features so this engine is consistently getting upgraded and worked upon which is very exciting as if you are someone that is looking to get into game development then Godot is a very highly recommended engine to begin with as it is quite user friendly it is very lightweight um and it also has its own included code editor so you don't have to download any other external programs everything's self-contained in the engine so you can get started right away now in this course we are going to cover a wide range of different topics first of all learning the Godot editor okay we're going to install Godot and then we are going to have a look at the editor itself this is the piece of software that we are going to be spending all of our time in um creating our game writing our code dragging around our nodes and scenes modifying all of those so we're going to get an understanding of how each of these different windows work and how they are used in order to create a game then we are going to learn the fundamentals as well as 2D so we're going to be learning about nodes scenes tools uh the idea of parenting and how to use cameras then once we understand the fundamentals and we know how to work with them inside of 2D we're going to jump over to a 3D environment and look at how we can basically create our games inside of a 3D World so we're going to be looking at 3D models we're going to be looking at applying materials through those models as well as lighting okay all the fundamentals you need for creating 3D games and then we're going to jump into scripting zenva is an online Learn Academy with over 1 million students we feature a wide range of courses for people who are just starting out or for people who just want to learn something new the courses are also very versatile allow me to learn in really whatever way you want you can choose to view the online video tutorials read the include lesson summaries or follow along with the instructor with the included course files alright now let's get started with the first lesson welcome everyone in this lesson we are going to be looking at installing the Godot game engine so here I am on godotengine.org this is godot's website and is where you want to go if you want to download the engine so here I am on the home page and all I'm going to do is go down to where we have this download latest button right here okay because we want the latest version of Godot which comes with all of the cool new features and Bug fixes okay so we do want to be up to date with that so I'm going to click on download latest right here and that is going to take us over to our downloads page and as you can see here it says download Godot for Windows now I am using Windows but if you are using Mac or Linux it should say Mac or Linux right here then what we can do is click on the blue Godot engine button right here and that should begin the download of the files now the good thing about Godot is that it is a very lightweight engine compared to many of the others out there on the market Godot is only really around 50 to 100 megabytes in size so as you can see my download is pretty much complete right now um and it is very portable as well okay you don't have to download and install a bunch of files into your hard drive and all of that rather it is just one simple executable that you can click and drag to anywhere on your computer if you want to store it on a USB and launch Godot from there you can easily do that so now that the file has finished downloading we can click on it and open it up now this opens up in a zip file and basically what we have here are two different executables we have the main engine right here which is around 100 megabytes in size and the console now with Godot we don't really need to worry about the console right here um so I'm going to do is I'm just going to click and drag on the main executable right here and drag it out to extract it now I recommend storing this somewhere such as your documents and you can of course then create a shortcut to open it up or you can just open up the executable by double clicking on it which we can do right now so if I double click on this executable it is going to open up the Godot project manager right here and if you get a pop-up like this we can just click cancel because we don't want to worry about you know importing any projects just yet so here we are in the Godot engine project manager now this isn't the program where we're going to be creating our games rather the project manager is in charge of managing our projects basically it lists out all of the different projects that we've created on our computer as of course you will be creating many in the future for all your different game ideas and this is where we can first of all create new projects open up existing projects uh check to see which versions and manage Version Control as well as removing projects if we no longer need them okay this is just a nice little piece of software which centralizes all of our different Godot games so in the next lesson what we are going to do is work on setting up our first Godot project and opening it up so thanks for watching and I'll see you all then welcome back everyone in this lesson we are going to be working on setting up our first Godot project so here I am inside of the Godot engine project manager and if you don't have this window open then all you need to do is find your Godot executable double click on it and that should open up the project manager right here okay now this is um a program which basically allows us to create new Godot projects it allows us to basically open up other ones delete them if we no longer need them it's just a way of centralizing all of our different Godot projects so how do we create a new one well first of all we want to go to the top right corner of the window and click on the new project button right here this is going to open up another window right here which allows us to set up a few things first of all we can create a project name and for this what I'm going to do is I'm just going to call this let's just call this uh intro to Godot and then next we need to choose our project path and this is going to determine where our project files are going to be stored Now by default it should be in your documents folder which generally is probably a good place but if you wish you might also want to go ahead and create your own dedicated folder for your Godot projects so you can go ahead and do that by clicking on browse and then navigating to the respective folder okay but for me I'm going to store it here in documents and then we can click um just above here where it says create folder and what that going to do is create a brand new folder in documents called intro to Godot so we can click that there we go and now it should have a green tick saying that we are allowed to save it here um and apart from that we can click create and edit and what that's going to do is it's going to close down the project manager and open up the Godot engine and here we are inside of the Godot engine okay as you can see there are a lot of different buttons and text labels and things um that may be a bit confusing to start off with but in the next lesson we are going to be looking at what each of these different Windows do what the buttons do and how we can navigate around the engine so thanks for watching and I'll see you all then in the next lesson welcome back everyone in this lesson we are going to be looking at exploring and understanding the Godot editor so when we went ahead and created our project we have this window which opens up and this is where we are going to spend all of our time making our game writing our code and testing it out so it's a good idea to get an understanding of what this piece of software is how we can navigate around it and what each of these things on screen do so first of all uh Godot the main chunk of what you can see right now is separated into a bunch of different Windows okay you can see here that we have these different rectangles which are snapping together and if we click and drag on the lines between the windows we can resize them as you can see here we just click and drag between these two windows to resize them and this allows us to basically rearrange and resize the different elements to fit your needs and to fix your preferences now what do these different Windows actually do well first of all down here in the bottom left you can see that we have a little tab that says a file system now the file system is basically like your file explorer on your computer and this basically allows us to see all of the different folders and files that make up our project so when we start writing down code or importing 3D models textures audio files those get stored down here in the file system and it allows us to create subfolders to store them in and just organize our project you can see we have one file right here which is called icon.svg and this is pretty much just the icon for our game by default okay now we will get into the file system a bit more once we start actually creating some files creating some scenes but right now as you can see it's pretty empty now over here in the center of the screen this is probably the most prominent window and this is basically a look into our game this is where we can basically see into our game World this is where we can construct our levels this is where we can construct our player scenes and everything else and we will get a better understanding of this once we actually start creating our game now as you can see right now it has a 3D view okay we can see the distance right here we can see our Vanishing lines um but Godot is a 3D and a 2d engine and you can see that at the top here we have these four buttons right here with 3D highlighted now if you want to switch over to 2D mode we can just click on 2D right here and that is going to swap this Center window over to a 2d perspective we can go back to 3D we can even click on script right here and that will change the middle window over into our script editor and this is where we can basically write down our code now we're not going to be focusing on code at the moment so we can just ignore this for now and go back to let's just say 2D okay now here in our 2D what we can do is then go over to the scene window and the scene window right here is basically a list of all the nodes that make up our game now the way Godot works is with nodes okay you can think of pretty much everything as a node and a node can have children nodes and those nodes can have children nodes in of themselves we are going to be looking at what nodes are and how they interact with each other in a future lesson but right now just know that everything in your game is made up of nodes and what that means is at the top there needs to be a root node and as you can see here it says create root node we can create a 2d scene a 3D scene a user interface or other now this is a 2d scene we're working with right now so I'm going to click on 2D scene right here and that is going to create ourselves a node now you'll see if I select this node over here on the right hand side in the inspector window we have have this information appear okay so I can click anywhere else to deselect it and if I select the node 2D it appears with information right here now the inspector is basically like looking into whatever node we have currently selected so if we were to select for example a player node then we would see all of the players information such as its position its stats and any of the other properties that we might want to modify with it so you can see on our node 2D right here we have a bunch of these little drop down uh tabs that we can look into such as transform which gives us our position rotation scale and depending on the Node um it's going to have different properties such as a Sprite node is going to have the ability to assign a texture a mesh instance node is going to have the ability to assign a 3D model and Etc so for right now just know that on the left hand side here in the scene window is where we have a list of all of our nodes and if we select a node in the inspector that is where we can actually modify its properties and if it is a node that has a visual aspect to it such as a player an enemy a tile Etc it is also going to appear here in the middle in this scene viewport window now how do we actually play our game well at the top right corner here of our screen you'll see we have a few different buttons first up we have the play button now if we click on that it's going to ask us to confirm our default scene so we'll just go select current and it's going to ask us to save our scene first and I'm just going to save this as our test scene hit save and it's going to launch up our game window right here now this is pretty much a window which is going to be our game as it is now to get out of this we can just click on the X on this window or we can click on the stop button at the top right corner of the editor and that's going to close that out now down here in the file system you'll see that we have added a new file to our file system and that is our test scene dot tscn okay now we're going to get into scenes in a future lesson as well as nodes but for now just know that a scene is basically a collection of nodes apart from that we also have the output right here at the bottom so when we press play on our game the output opened up and this is basically a window which can be a relay error messages or Warnings that we might want to be aware of okay so if there's some problem in our game the output right here is going to open up and it is going to display in red you know what problem has occurred so that is a quick overview of the Godot engine editor right here as well we also have some menu buttons at the top here so scene we can choose to create a new scene we can open a scene we can save the current scene we are in Project we have our project settings button right here which opens up this window and this is where you can manage a lot of the background settings for your project such as the name how big you want the window to be some rendering and text settings that you might want to get into a bit later on so yeah project settings is an important window but we're not going to be focusing on it just yet in the next lesson we are going to be looking at understanding what is a node and what is a scene because those are two vitally important things for understanding how the Godot engine works so thanks for watching and I'll see you all then hey everyone and welcome back in this lesson we are going to be looking at how we can navigate around our scene in the Godot engine so in the center here we have our main scene view pool and this is basically like a window into our game okay looking at our environment and it allows us to basically create stuff drag stuff in move stuff around but how do we ourselves navigate this environment well in 2D mode right here all we need to do is hold down middle Mouse and drag okay and as you can see we can middle Mouse and drag to basically pan around this screen now there's not a lot to look at um but you can see we have these lines right here and we can easily pan around like so and if we want to zoom in we can just use the scroll wheel and to zoom in and scroll down to zoom out okay now what about if we are in 3D well let's hop over to 3D at the top here by clicking on the 3D button that's going to swap us over into this 3D environment right here and we can hold middle Mouse and as you can see if I hold a middle Mouse and move my mouse around it sort of rotates around the center okay we are orbiting around wherever we are currently focused on and if I hold down right Mouse our camera switches into this sort of first person perspective where we can look around as if we're playing a first person game and as long as I as as long as I am holding right Mouse button I can then use the w a s and D keys to fly around okay as you can see right here we can use e to go up Q to go down and fly like so so thanks for watching and I'll see you all then in the next lesson hey everyone in this lesson we are going to be looking at how we can import some assets that we are going to be using throughout the course so an asset is basically a file which we can use in our game okay anything from textures to 3D models uh audio clips sound effects scripts uh any file that we can store on our computer and use in our game now for this project we are going to be using a couple Sprites which are basically 2D textures that we are going to be using for 2D games so in the course files tab of this course there should be a zip file which contains the assets needed for this course so go ahead download that and then when when you open up that zip file you just want to extract the contents and you should then have a folder called Sprites okay and inside of Sprites you should have a player Sprite and a coin Sprite now what we are going to do is we're going to go over into Godot right here go down to the file system we are going to right click we are going to go new folder and we're going to create a new folder called we'll call this one out Sprites okay hit enter and as you can see here we have a brand new folder now what we can do is import our assets and store them inside of Sprites right here so I'm going to open up that folder once again which contains my coin and player and I'm just going to click and drag into the Sprites folder like so and as you can see we can then open it up and we have our player Sprite let's do the same thing for the coin there we go so now in our file system here we have a Sprites folder which contains coin and player and the process for importing other assets such as audio files 3D models textures it works in the exact same way okay you just need to click and drag into your file system and then those assets are going to be stored in your project files and pretty much ready for you to use hey everyone in this lesson we are going to be looking at the concept of nodes and scenes inside of Godot now it's important to note that everything in your Godot project in your Godot game is made up of notes okay your player your enemies your environment your lights your backgrounds your camera everything that can have a position in space or that can contain some sort of logic behind it is made up of a node and nodes can have children nodes which can have children nodes so pretty much Godot is based off a hierarchy of nodes and we're going to look at how we can create those and how they work so over in the scene window right now you can see we already have a node which we created and this is what's known as the root node okay this is basically the utmost node in our scene and this is gonna is going to contain everything else that we want to include in this scene right here and you can think of a scene as a collection of nodes that can be instanced at any time okay so for example your levels you know you might have a level one level two level three each of those are going to be its own scene which we are going to load in whenever we want to play them but scenes can also extend to other sets of nodes that we might want to have repeated instances of such as our player you know we might want to have our play in level 1 in level two um and that could be then a scene as well the same goes for enemies okay you probably want to have dozens of enemies at once in your game and the easy way to do that is by making one enemy saving it as a scene and then spawning that scene in multiple times okay we'll have a better understanding of how this works in just a bit let's look at nodes so we have our node 2D right here which is our root node for this scene if we select it you'll see that over in the inspector we can have a look inside of that node and View and modify its properties okay such as its transformed position rotation and scale although for the root node you don't really want to be modifying the position rotational and or scale for this generally with your root node you just want to leave it as is so we're not going to touch anything with that um but what we can do is also go ahead and create some new nodes so let's click on the plus at the top left corner of our scene window and that is going to open up the create new node window now as you can see there are a lot of different nodes here we can choose from and if we go down to where it says node 2D we have a little drop down arrow which if we click is going to show us all the different types of 2D nodes we can choose from and down here we have node 3D which shows us all of the 3D nodes that we can choose from as well okay and control is for UI elements like text buttons and and on-screen images but we're not going to look at that for now let's focus on the Node 2D nodes and you can tell they are 2D based on the fact that the icons are blue okay now let's go ahead and create ourselves a node let's go down to where we have Sprite 2D and as you can see we have a little description down here which is a general purpose Sprite node let's click create that's going to create a brand new node as a child of the root node and that is the way this all the works okay a node hierarchy nodes are going to have children which basically inherit their position rotation and scale and nodes can have pretty much as many children as they want and even those children nodes can have nodes you can have children nodes of themselves okay it can get pretty complicated once you have big scenes so we have our Sprite 2D right here so at the moment it is called Sprite 2D but you know let's rename it to something that's a bit easy to understand so I'm going to double click on the Sprite name on on the Node name I mean and we can then rename it to something such as player okay now you can also see what type of node a node is by looking at the icon okay so we have this little smiley face with a Sprite node or if you don't know the icon you can go over to the inspector and have a look at what type of note it is right here now this is a Sprite 2D node which means it renders a Sprite and a Sprite is essentially just a texture that we are rendering in our game so what we can do is go over to the texture property of our Sprite 2D node and you see right here it says empty and this means that we can assign a Sprite so I'm going to go down to my file system and you'll see here that we have our player.png well all I'm going to do is just click and drag that into the texture property right here and when I let go you'll see over in our scene viewport right here we have our player texture or our player spray rendering on screen okay so we can zoom into that to have a better look and there we go so our player Sprite is now rendering at this node right here and if we go over into the transform property of our node 2D you can see we can modify the position on the X and the y-axis okay the x-axis is horizontal and y is vertical you can think of it like a graph so I can go to the X position here and change that property to let's just say 50 and as you can see we are now 50 pixels to the right if I go negative 150 we are now negative 150 pixels from the center of our root node okay our root node is directly in the center of the graph right here with our player being positioned relative to it so we can even modify our y position to be let's just say uh 50 or we'll make it let's say 70 and there we go our player is is now 70 pixels down and 150 pixels to the left we can also modify our rotation if we want okay this is in degrees so you can do full 360. but I'm just going to keep that at zero and scale here modifies the size so if I make this 2 on The X you can see it is then two times as large let's bring that back down to one okay so now that we know how to create nodes let's look at the idea of scenes so right now in our test scene here you know we have our player and now let now let's just say we want to have you know multiple different um players in our scene or enemies or rocks or trees or anything that you want to have multiple instances of yet are at their core the same thing well what I'm going to do is Select our player go Ctrl D to duplicate it then we can go over into transform let's give it a position change of uh we'll go a negative 50. all right we'll go at negative 100 so the player is a bit to the left and we have now created two player nodes now we can also go ahead and duplicate that again and another way to duplicate is by just right clicking the node and going down to duplicate okay we can then change that transform position to be let's just say 100 on the Y so now we have three players in our test scene okay well let's just say with our player we want to change their color how do we go about doing that well we can select our player node we can go down to the visibility drop down here and change where it says modulate and modulate is basically a color multiplier so we can then change our color here okay we can just mess around these settings here until we find a color that we like there we go like green and then let's just say you know we want all of our players to be the exact same so let's go through and do the exact same thing to this other player here okay we can change their color and as you can see it's it's going to take a bit of time if you have a lot of stuff and you can also think of this as if you have um let's just say you have a 3D environment and you have a bunch of trees in your level okay and you want to basically make a change to all of those trees let's just say um you know the games changed a bit and you want these trees to have more flowers or you want these trees to be able to sway in the wind well you'd have to go through every single tree node and apply those changes okay and that can take time depending on how many you have if you have a bunch of collectibles in your game and you want to change the speed of the Collectibles animation you know that could take you a long time going through hundreds of Collectibles so a better way of doing this is by turning our player into a scene so I'm going to go ahead and delete these other two player nodes right here let's bring that modulate color back to White so I can play it no longer is green and what I'm going to do is I'm going to select our player node I'm going to right click it and I'm going to go down to where it says Save branch as seen okay we're going to click that we can then give our player scene a name I'm going to call it player hit save and then down here in our file system you'll see that we have a brand new file called player.tscn now if I double click on that that is going to open up a brand new uh scene window here as you can see at the top we have two tabs we have test scene and we have player and you can see that in our player scene the root node is that Sprite node now what we can do is if we go back to our test scene here we can drag our player.tscn from our file system into our test scene here okay we can drag in a bunch of them if we wish now let's do the same thing as before let's go ahead and change the player's color well we could go ahead and change the visibility and all that but instead what we are going to do is we are going to make a change to our player scene okay because remember all of these nodes right here are an instance of our player scene okay everything that we change in our player scene gets applied to these nodes because they are basically a creation of the player scene blueprint so if we go over to our player scene what we can do select that node go down to visibility go modulate let's change this color to we'll make it a sort of a reddish pink color like so and if we save it with Ctrl s go back to our test scene you can see that every single player node is now this red color and that is because their properties are inheriting from that player scene okay and with scenes we could add a bunch of different nodes here um so if I right click on player I can go add child node and let's just say as a child of this player we want another Sprite so I can go Sprite 2D find that in the list create that let's set the texture this time to be coin okay and we might then want to go transform we want to move the coin let's just say just above the player's head so I'm just going to go negative 50. there we go we've got the coin above the player's head and as you can see here it is a child of players so wherever player goes this Sprite will follow as well we can save that go back to our test scene and as you can see every instance of that player scene now has that change applied hey everyone in this lesson we are going to be looking at the different tools that we can use in order to move rotate and scale our nodes now we already know that if we select a node we can go over into the inspector down to transform and we can modify the position rotation and scale properties right here but you know this can be a bit annoying if we're trying to specifically position something we don't always know exactly where in the world we want to put it based on a number so what we can also do then is with a node selected we can go to the top left corner of our scene viewport and you see there are these four tools okay we have the select mode we have the move mode we have the rotate mode and we have the scale mode okay now we can select these tools by just left clicking on them and if I click the select mode what this means is I can select a node whenever I click on it as you can see I can click on a node and it becomes highlighted now with the select tool we can then select a node and then we can go over to the move mode for example and you can see that it changes a bit we have now this little Gizmo on screen which has two arrows a red arrow pointing to the right and a green arrow pointing down this basically means that we can modify the position of this node so if I click and drag on it now as you can see I am now basically moving it around so I can move it over here move it over here and we can also use our keyboard shortcuts to navigate between these so if we want to go back to the select mode we can just press Q on our keyboard to select a node we can then press W to go to the move tool and move it around now as well as this we also have the rotate mode which is this third button right here with the keyboard shortcut of e and basically this means if we click and drag on a node we can then rotate it around like so okay and if we press s or go to the scale mode right here we can click and drag to change the size of this Sprite and as you can see we can click and drag on these individual boxes so if I click and drag on the red one it scales it along the x-axis and if I click and drag along the green box it scales along the y-axis so let's just rotate that back into its normal orientation go back to the move tool move that around a bit and with the move tool if you want to move it along a specific axis you can just click and drag on these lines as well okay so I can click and drag on the red arrow to move it along specifically oops move it specifically along the x-axis or I can click and drag on the Green Arrow to move it specifically along the y-axis okay just like that so that is a look at the select move rotate and scale tools inside of Godot okay so as a bit of a challenge this is what I want you to attempt I want you to first of all create a brand new Sprite 2D node with the coin texture okay we have those two textures we have the player and the coin and then I want you to duplicate position rotate and scale those nodes in order to match the image on the right hand side so you can see over here there we have six different nodes uh positioned rotated and scaled in a certain order like so so that is your challenge have a got that and I'll be right back to see how you're done all right so I hope you had a go at that challenge pretty much what we want to do is let's just pan over here so we have a bit of room um we first of all want to create our Sprite 2D node now in order to do that we could go ahead click on the plus create the node here but an easy way of doing that is if you already know what Sprite you're going to use we can go down to the file system click our coin dot PNG and just drag that into our scene and and as you can see it's going to automatically create a brand new Sprite 2D node it's going to assign the texture and give it a name of coin which is great so what we want to do now is we pretty much want to select this coin press W to go to the move tool move it up here a bit press Ctrl D to D duplicate that we then want to move this one down a bit here and then we want to then go Ctrl D again move this one over here to the right we then want to press s to go to the scale tool now as you can see it's a bit hard to get the right scale um so it's even so what we can do is hold down shift and that is going to scale uniformly along all axes so we can scale this one down here a bit go back to the move tool move it over Ctrl d move this one over here Ctrl D once again move this over here we can then scale this up a bit and we can then press e for the rotate tool and we can click and drag to rotate this around now you might not be able to get a proper rotation on this so once again just like um with scaling we can hold down control this time and this sort of snaps the rotation as you can see here so we can get a nice Square angle like that we can then duplicate that once more and move it over here and there we go we now have our little structure of nodes here which have each been moved rotated or scaled into the correct position for them and that is the challenge complete so I recommend that you do have a go uh continuing to learn the select move rotate and scale tools as you'll be using them all throughout your Godot projects okay to align certain colliders with Sprites to um dragging and dropping in pretty much any piece of or any scene or node structure that you want for your game such as enemies rocks Collectibles eventually with UI elements as well you'll need to be knowing these tools um so yeah have a go at that and in the next lesson we are going to have a further look at parenting inside of Godot so thanks for watching and I'll see you all then welcome back everyone in this lesson we are going to be looking at the concept of parenting inside of the Godot engine now we've already looked at parenting in the fact that we have created nodes so whenever you create a node unless it is the root node which we have right here then you are making a child node of another okay so let's start by creating ourselves a node so I'm going to go ahead click on the plus and I'm going to search for sprite there we go create the Sprite 2D node and now as you can see in our scene window right here uh Sprite 2D isn't in line with no 2dk rather it has a bit of a inline right here denoting that it is a child node and node 2D even has a little drop down button right here to toggle uh open and close its children nodes so in your scene everything is going to be a child of the root node okay now we can also have children of children knows so if I select the Sprite 2D right here let's assign the player.png to the texture okay and what we can then do is we can attach another child node to this so what we can do for that is right click on Sprite 2D go add child node and let's just say for this character we want to give them a collider well we can search for Collision shape 2D let's create that and as you can see that is then indented as well into Sprite 2D so now Collision shape 2D is a child of sprite 2D so if I click select the Collision shape node we can then go ahead to where it says shape click on the little drop down here and then we can choose something like rectangle shape 2D that's going to create a blue box right here which we can then go ahead and click and drag on these little nodes to resize something like that there we go so now we have a Sprite node which has a collider on it and then what we can do is Select our Sprite 2D and if I click and drag on these arrows here to move it around go W to get to the move tool we can move it around and you'll see that the Collision shape follows along now the reason why it is following along is because if your node is a child it is going to inherit your properties such as your position rotation and scale so if I then go to the rotate tool and I rotate this around you can see that the Collision shape 2D also rotates and if I go to the scale tool it also scales okay so that's the great thing about these children nodes so if you have a player for example and you want the player to be holding onto an item well that item as long as it is a child of the player node it's going to follow that player along wherever it goes and a good way of having a camera follow the player is by making the camera a child of the player and that basically means that wherever your player goes the camera is going to be locked on them so yeah that is just a quick look at creating um or using parenting inside of Godot and this is going to become second nature once you start creating all of your games and all of your different scenes so thanks for watching hey everyone so far in our Godot Journey we have been looking at 2D scenes and 2D nodes well Godot is a very versatile engine and actually allows us to also create 3D games so how do we go about doing that well let's go ahead and create a brand new scene for our 3D level and to do this we are just going to go to the top left where we have seen and we're going to go new scene okay that's going to create a brand new scene here and we need to choose a root node now when creating a 3D scene you of course need to have a root node of 3D so we'll click on 3D scene right here and as you can see it's going to switch us over into 3D mode and it's going to create a node 3D so I'm going to go up to scene save scene as and I'm just going to call this one our uh we'll go test scene 3D there we go so now we have our 3D environment right here now once again to navigate around this we can hold right Mouse to look around use the wasd keys to fly e to go up Q to go down and we can then middle Mouse to sort of orbit around what we are focusing on okay those are the basic controls for our 3D environment right here now how do we actually create stuff well in 2D Godot we have Sprites to pretty much show us you know some sort of visual aspect whereas in 3D we can create what's known as a mesh instance node and a mesh instance node is a node that can render a 3D object so I'm going to click on the plus to create a brand new node and I am going to search for mesh instance 3D right here click create that's going to create a new mesh instance node we can then go over to our inspector now if you already have a 3D model that you want to use you can just drag that in although for us we can click on the little drop down here and we can choose to create a brand new uh basic primitive mesh so I'm going to click on new box mesh right here and as you can see that is going to create ourselves a brand new Cube but yeah we have our Cube here and just like in 2D we can go to our move tool and we can move it along by clicking and dragging on these arrows but you will notice that in 3D we don't just have the X and the y axis but we also have the z-axis which is the blue one right here okay and that is because in 2D space we only need two axes in order to denote a point in space whereas in 3D we need three values okay the X Y and Z and if we go over to our transform drop down here where we have our position property you can see we now have three boxes to fill each of those in now it is also different on the unit of measurement from 2D to 3D in 2D we are measuring um distances in terms of pixels so um you know 100 pixels may only be like the width of your character whereas in 3D it uses meters and as you can see if I click and drag along on the red axis you can see here in the transform property the x-axis goes from zero over here to one over here okay that is a one meter distance and we can of course fill this in ourselves so let's say we want to go five meters along the x-axis that brings us all the way over here one meter up that's going to bring us up here and let's just say negative two meters back on the Z that's going to bring us over here okay now you'll see on the Move tool we also have these little um squares and if we click and drag on those that basically moves us along a specific plane okay so if we click on this green one that's going to move us along pretty much every axis but the Y if we click and drag on the red one that's going to move us along the Y and the Z axis and the blue one is going to move us along the X and the y-axis okay now what we can also then do is we can rotate as well so if we press e we go to the rotate tool and it does look a bit different um so we have each of these different axes that we can rotate along like so or we can just click and drag in the middle of the sphere to rotate it along our current viewpoint okay um it should be pretty intuitive once you get actually um working with these tools and again if we press R we have our scale tool we can scale along each of these individual axes like so or if we click and drag in the center we can scale along all of these axes so yeah that is a quick look at the tools um that we use for 3D again they're pretty much the same as 2D yet with an extra axis uh added on top okay because again we are working in 3D space okay so as a bit of a challenge this is what I want you to do I want you to go ahead and create a snowman using multiple mesh instance 3D notes okay like on the image on the right hand side here and for this you're going to be using the selection move rotate and scale tools okay so have a look at that image on the right um see what you need to do and then go ahead and attempt it and I'll be right back to see how you're done welcome back everyone I hope you had to go at that challenge so let's look at how we can accomplish it first of all we need to create a mesh instance node so I'm going to click on the plus search for mesh instance 3D there we go let's create that now and we can then go over to the inspector go to the mesh property click on little drop down arrow and we are going to go down to where we have new sphere mesh okay create that just like so we can then go Ctrl D to duplicate it using the move tool we can move up we can then scale this down we can then duplicate that again and then scale that down for the head now for the arms what we can do is I'm just going to duplicate one of these mesh instance nodes and then we can go over to mesh and change that to a box mesh okay move that up we then want to scale so we have nice thin arms but we want to make them long like so and there we go that is how we can make a snowman using these mesh instance nodes now as a bonus what we can also do is make it so that these are all the child of its own separate nodes so if we want to make multiple instances of these snowmen we don't have to select all three or or four of these mesh instances in order to do so and the way we can do that is by creating a brand new node 3D okay create that let's double click on it let's call this one snow and we can then select our mesh instances and drag those in as a child of snow so pretty much click and drag on a node and hover it over another to make it a child now if I click on snow here you can see everything gets selected and I can then move it like so okay we can even go to the scale tool scale everything up or down even rotate everything around as well so you can see just like I mentioned before in 2D every single positional rotational and scaling change we make to the parent node also gets applied to the children okay so we can move them around as one whole welcome back everyone in this lesson we are going to be looking at materials inside of Godot now first up what is a material well in 3D rendering a material is basically a file which tells our computer what we want an object to look like how we want something to be rendered to our screen okay now in fact we're already using materials right now these mesh instances right here have a default material on them okay it's nothing special nothing flashy but it is as you can see here casting Shadows it is um you know detecting where the light is coming from and rendering it to our screen with the correct shading so we already have a material here but you know you probably don't want your things to look like this you probably want them to have a bit more color maybe even some texture so what we're going to do is create a material so let's go down to our file system here I'm going to right click and create a new folder called materials and then inside of this materials folder we want to create a new material and to do that we can right click go new and then resource now a resource is pretty much what Godot calls their assets okay and as you can see there are a bunch of different resources that we can create so I'm going to search for material okay and you can see here there are a bunch of different materials um so what we want to do is go down to where we have a standard material 3D okay and this basically allows us to do what we want so click create we need to give it a name I'm just going to call this one our test material since we are going to be changing a few things around on it hit save and if we open up our materials folder you'll see that we have a test material.tres okay and there it is now if I select this test material you'll see that over in the inspector we all of a sudden have a bunch of different settings okay transparency shading vertex color Albedo we have all these things to modify um for this material so there are a lot of things that you can change about it such as the the texture the roughness the shininess the color the transparency and I'll give you the opportunity to go through and do that yourselves as there are plenty of different things to change but for us we are just going to change the Albedo which is the color of the material so I'm going to open up the Albedo drop down here I'm going to select the color property and we can then go ahead and change this to something let's just say we want to make it green now if you're having a bit of trouble um selecting the color that you're trying to get you can go over to where we have the HSV and I think this is probably my favorite color picker so we can choose the Hue choose our saturation and then our Vibrance okay so I'm going to choose a let's just say a greenish color oops greenish color right there there we go a nice vibrant green as you can see we have this little preview window which shows us our changes we can even go down to roughness and change the roughness value and if I drag that down you can see it gets really shiny because if something is not rough at all then it is smooth thus it's going to reflect a lot of stuff so let's bring that roughness down to around 0.2 so we have nice specular highlights all right now how do we actually apply this to our mesh well what we can do is just click and drag on the material and hover over the mesh that we want to apply it to so we can click and drag on our head our body our legs and our arms and there we go and as you can see we now have this material applied and automatically it makes our snowman look quite a bit different okay we have a more soft I'd say reflective plasticky looking substance than we had before and we can even select our material and change these properties live so let's say we want to bump up the roughness to make it look more um more of a matte color we can bring the roughness all the way down so it is now pretty much reflective but you can't really see the reflectiveness that much here so bringing roughness up a tiny bit go to metallic we can change the metallic value and as you can see if I bring that all the way up it pretty much looks like it is a nice shiny steel Ball but I'm going to bring that down a bit here and yeah have fun just going through changing these different things we even have Rim which is going to give us a fresnel effect on the outside of our thing here as you can see um so yeah okay so as a bit of a challenge this is what I want you to do below we have these three materials that I've gone ahead and created and I want you to try and uh replicate them now the one on the left is probably one you know that we've seen so far we have an Albedo we have a high roughness uh then the one in the middle is using transparency so I want you to explore and experiment with the transparency settings of the materials and then on the right hand side we are assigning a texture to this material so I want you to go ahead and try and replicate these three uh and in the next lesson we're going to go over how we can accomplish those so thanks for watching and have a go at the challenge all right so I hope you had to go at that challenge pretty much what we want to do is first of all create our three spheres so I'm going to go ahead create a mesh instance 3D here assign that mesh to be a new where is it new sphere we can then duplicate that and make two more on either side there we go so now that we have our spheres we then need to create materials for them so inside of our materials folder I'm going to right click on it Go new resource I'm going to go down to where we have standard material 3D and I'm going to call this one pink ball okay now for our pink ball we can click and drag on that sphere as you can see it doesn't really change much since the default material is very similar to the one that gets assigned when we actually create the mesh but we can click and drag it on we can then go over to the inspector change the Albedo color here I'm going to make that a nice vibrant pink something like that and we can then change the roughness um actually now keep the roughness at one I reckon I think that's going to be a good idea there we go now we can move on to the second ball and this is going to be transparency so I'm going to right click on materials folder go new resource standard material 3D I'm going to call this one blue transparent okay or technically translucent um so I'm going to click and drag on the center one here we can then go in the inspector down to Albedo let's just give our ball its blue color real quick there we go and then we can go over to the transparency drop down here and right now transparency is set to disabled so we want to click on that drop down and change it to Alpha now what we can do is go back to our Albedo open up that color again and you'll see here we have our RGB a values red green blue and Alpha and Alpha is basically transparency so we can click on drag on that slider to bring that down in transparency as you can see here and now if we pin our camera around we can actually see through our ball now with transparency there are a bunch of different types of modes for transparency so if I click on the transparency drop down again you see we have alpha alpha scissor Alpha hash so if we go out for hash for example you can see that it basically um has this solid blue mixed with totally invisible okay so it gives the appearance of transparency and depending on you know the rendering situation it may be better performance for your game to do it this way but I'm going to switch that back to Alpha we also have our blender mode which basically determines how it renders the transparency based on what is been is behind it so if we go add that means it's going to add this blue color to whatever it is behind subtract subtracts it so as you can see it has this weird looking effect right here and multiply is multiplying the colors together okay so that's going to make it a bit darker but typically mix is what you were looking for um for the blend mode now for our final sphere we are going to be applying a texture so I'm going to right click on materials once again go new resource standard material 3D and I'm going to call this one our texture ball okay click and drag on the sphere and to apply a texture what we need to do is go down to where we have Albedo and you'll see here we can of course change the color but we can also assign a texture and that is going to be the flat color texture for our ball and for this I'm just going to be using our player Sprite so we can just click and drag that in here and there we go so as you can see we have our player right here we can even click on the color property and we can actually modify the color that is sort of being multiplied by the texture okay so if we want the texture to look more blue we can do that if we want to make it look more red we can change it to red okay and that is pretty much the basis of materials inside of Godot once again there are a lot of different settings here for you to change and I just hope that you go ahead and experiment with these as you can create some pretty interesting looking materials for your games so thanks for watching hey everyone in this lesson we are going to be looking at lighting inside of the Godot engine okay now when working in 3D lighting is very important as it sets the mood and it sets the theme of your game so how do we create lights inside of Godot well first of all let's get an actual mesh in here so we can see what effect it has on uh the actual environment so I'm going to click on the plus I'm going to create a new mesh instance 3D and we can change that to be a sphere okay there we go so we've got our mesh here now let's go ahead and apply some lighting to it now if we click on the plus and we search for light you'll see there are three different types of Lights we can create we can create a directional light an omni light and a spotlight now let's start with directional light so I'm going to select it and click create now a directional light is basically like the sun okay our sun shoots down rays of light parallel to each other and that's essentially what a directional light does it casts a light in a single Direction so if we go to the rotate tool here with the directional light selected you can see that we have this white arrow pointing in the direction that the light is being shown from and you can see we even have a little Sun up here in the Sky Box to show where it's coming from and you'll see on our sphere here the left hand side is being hit by that light and if we rotate this directional light you can see how it changes the actual uh Source or the direction of that light now good thing about directional light is that it can be moved around anywhere in the scene but the position does not affect whether light is coming from because it's basically coming from an infinite distance away it's only the rotation that really matters when it comes to the directional light okay so you can see here we can modify our directional light rotation to modify where on the sphere it has been hit with light now something else we can do with the light is many things actually if we go over to the inspector and open up the light drop down here you'll see there are a bunch of different settings we can change for example the color is as it sounds it's the color of the light so if for example it's night time you might want to have a bit more of a coldish blue light so something like this maybe whereas if it's daytime you probably want a nice vibrant slightly yellow hued light okay and you can go ahead and modify those for whatever you wish the energy this is basically the intensity of the light okay and as you can see if I pump this up um our sphere starts to pretty much glow if we increase the energy there um whereas if we put it at zero it's as if there is no light so I'm going to bring that back up to one uh we don't really need to worry about the rest of these settings here since they are all uh for light baking and a much more complex lighting so we're just going to ignore those for now okay so we have our directional light now what about those other light types well click on the plus and let's create what's known as an omnilite 3D so we'll create our omni light and with this you'll see it has uh a sphere okay this wireframe sphere on the outside and this basically is a light that emits from a single point in all directions okay you can think of it like a candle a light bulb okay it has a source of the light and it emits in all directions so what we can do is we can press W to go to our move tool let's move this line over here and as you can see it is lining up our sphere and this white um wireframe is basically the range of the light I mean click and drag on this little orange node right here to basically change the range of that light now to make things a bit easier to see I'm going to go ahead and create a new mesh instance 3D let's set this mesh to be a plane and that's basically like a solid ground let's increase that scale move it down a bit there we go okay so we'll select the Omni light again we can move it around to have a better viewing of it to actually see what we are casting let's change that light color over to I'm going to change that over to a we'll change it over to a red okay we'll make a nice red light here and we can then bump up the energy a bit and we can then see how that affects our surroundings okay now it might be a bit hard to see because of um the white ground so what we can do is Select our directional light and let's bring that energy down to zero okay so now it's pretty much just our omni light shining here and you can see we can change all the settings the energy now to change the range we can open up the Omni drop down here and change the range we also got the attenuation which is basically the fall off curve now with lighting we also have shadows and so how do we apply those well let's first of all um set the energy of our omni light down to zero for now because we'll look at our directional light let's bring that directional light back up to one now how do we cast a shadow on this sphere onto the plane below well to do that we want to open up the shadow drop down here and just enable it and there we go it's pretty much done just like that um same thing for the omnilite if we bump up that energy we can go down to Shadow and enable that shadow as well and you can see there is a bit of a shadow cast here now it is important to note that Shadows um do have some performance cost but you shouldn't worry about that unless you have quite a few of them in your scene now finally we have one more light and I'm just going to delete our omni light here and delete our directional light and that is going to be our if we type in light our Spotlight 3D now Spotlight is pretty much as it sounds it is a light that emits in a cone okay these will be good things for headlights Street lamps if your character is holding a torch a spotlight would be good for that so I'm just going to rotate this Spotlight so it is facing down and you can see if we zoom out here that there is this white uh cone wireframe which basically shows us the angle which we can modify by clicking and dragging here as well as the range so we can modify those two things here we can then change the light energy so we might want to bump that up like so we can change the color so let's change this to be a uh we'll change this over to be a green for example there we go and of course just like with those other lights we can apply shadows as well and there you go so yeah that is just a quick look at these uh different Lighting systems that we can use inside of Godot we have the directional light which acts like a sun we have an omni light which acts as a light source that emits in all directions like a candle or a light bulb and then we have a spotlight which emits in a cone and that acts as if it's a torch or a street lamp so I'd recommend having a go experimenting with all these different lights as really there is a lot to learn when it comes to lighting so have fun experimenting with that hey everyone in this lesson we are going to be looking at scripting inside of the Godot engine now scripting is a very powerful thing and it basically allows us to write code which we can use to create whatever game we wish so first of all what is scripting well at its core scripting is how we can create the gameplay behaviors and Logic for our game okay and this is done via creating what's known as a script and a script is essentially a file which we can create in the file system okay so it's an asset and this is essentially just a text document which we fill with code and then what we can do is we can attach that script to a node okay each node at the bottom in the inspector you may have already seen this has a script property where we can assign a single script and then that script can do certain things uh to that node okay for example if we have a play we want to attach a player script to the player's node where it can then influence its position based on keyboard inputs or if you have some sort of enemy AI you might want to attach that to the enemy so let's hop over into Godot right now and look at how we can create a script okay so the first thing we want to do is we want to pretty much figure out what node we want to attach our script to now just for um demonstrational purposes I'm just going to select our root node right here and I'm going to go over to the inspector and you'll see here we have our script property okay and right now it is empty meaning there is no script attached so let's create one and attach it now to do this we could right click in the file system and create it that way or we can just click on the little drop down here next to the script property and go new script that's going to open up this attach node script window and this is where we can choose a bunch of different settings but really for us we just want to go down to where it says path and this is where we can change the name of our script so I'm just going to call this one intro to scripting.gd click create and it is going to do two things it's going to first of all create a brand new introdescripting.gd file down here in our file system and secondly it's going to switch us over into the scripting screen okay before we're in 2D we also have 3D and then it goes over to scripting which is where we can write down our code now there's a couple things already um inside of the script editor right here um some text and pretty much just like word or any other text editor we can click around and we can type stuff in okay so it's pretty much a text editor but specifically designed for the Godot scripting language which is called GD script okay if you do have any prior knowledge with programming then just know that GD script is very similar to python okay but you don't need to know anything whatsoever about programming or coding in order to follow along with this course we are going to go through everything from scratch so you can see here that we have all of our code written down which is just the the default code it gives us right now on the left hand side we have a list of all of the different scripts that we have okay so later on in your game when you have you know dozens of scripts you'll probably want to be jumping between them to write code edit stuff so this is where that list will appear and then down here we have all of our methods Decay listing out our methods and we'll get into what those are in a future lesson and what differs this from just opening up notepad or opening up any other word processor is because this piece of Godot is specifically designed for writing GD script and that means we have what's known as code formatting and that pretty much means that whenever we write down our code you can see that certain things are different colors okay we have some pink stuff some green some purple some blue okay it colors our code based on what we are writing okay because the program knows what we are doing okay it knows the language we are trying to write in and it colors the code based on that and that just makes it a lot easier to look at and identify certain things as well typically these sort of programs also have auto correct Decay um which basically means that when you're writing down code it tries to estimate um and assume what you want to do and it will pop up with a window with a bunch of different things so if you're not quite sure on what a certain thing was called in the language you can you know begin typing it and a box will appear and it might have your answer right there okay so we'll get into all of that later on but for now we have our script here inside of uh Godot ready to be edited okay so we can save this and in the next lesson we are going to be going over the concept of variables so thanks for watching and I'll see you all then welcome back everyone in this lesson we are going to be learning about variables now first of all what is a variable well basically a variable is a piece of data which we can Define read and change the value of okay it's basically um this piece of data that we saved to memory and we have the ability to utilize it now you can think of it like a box okay we can give a variable a name and assign it a value okay and at any time we can try and find the box that you know might say player's health and inside of that we have a value a number for example and we can look at that number so we know what it is we can also change it add to it subtract it multiply it pretty much anything we want to do with it okay and there are also different types of variables okay there are whole numbers decimal numbers text there are a bunch of different variable types that we will be going over so let's hop over into Godot and have a look at how we can start creating some variables okay so here we are inside of our script now the first thing we want to do is go to the right location to start creating our variables okay now you'll see we have this extends node 2D liner code right here pretty much we just want to go to a line or a couple lines underneath it okay and what we are going to do is we are going to create a variable now let's just say we want to create a variable that keeps track of a player's score okay well to do that we have to define the variable now to Define a variable we first of all have to write down the keyword VAR for variable add a space we need to give the variable a name so I'm going to write down score and then we can go equals and give it a value now let's say score equals zero by default okay and there we go VAR score equals zero VAR which is the keyword which defines a variable score which is what we are calling our variable equals zero okay we are assigning it a value of zero so we've created a variable now what do we do with it well for right now let's just print it to the output so we can actually see what it is now printing basically means we are logging a message to the output down here okay you see at the bottom left here we have the output we can click on that and that's going to open up uh the console the output and pretty much we can log messages here whenever we get errors in our code that is where they'll appear as well so you'll probably want to have this open most of the time when you're starting out as it's very handy in trying to in Catching uh you know all the little errors that you might write down so how do we print our score variable down here to the output well we want to go down to this thing right here where it says Funk ready okay and this here is basically what's known as a function we're going to get into what functions are a bit in the future but right now I just know that a function is a block of code that can be called at any time and the ready function gets called right at the start of the game to initialize stuff so we can do is remove this line of code where it says pass and write down print in two brackets score okay now what this is going to do is it is going to print and then in between these two brackets here we want to basically add in what we want to print in our case score so Ctrl s to save and then press the play button and let's see what happens okay I press play and if we look over here in the output we can see the number zero now we can stop playing that we can then change score for example to be five let's save that press play and down here in the output as you can see out it prints five which is great okay so we have the ability to create variables and print them out now we also need to go over the concept of variable types now the way Godot is uh or the way GD script I mean is is that it is what's known as a dynamic language meaning we don't have to hard Define specifically what we are doing and what we want and that allows us a lot of flexibility but generally um I'd say it's best practice especially early on to define the data types of your variables and by that I mean when we create a variable we need to basically tell it what type of variable it is going to be so in our case we have score and score is a number in our case it's going to be a whole number you know one two three four five Etc so what I'm going to do is after where we write down score I'm going to add a colon go space and then write down the word int okay for integer and that is a type of variable an integer is a whole number so this basically means that we are just defining score as being a variable that is a whole number now what about other variable types well let's go down to a new line here create another variable and this time we are going to create a variable of the of type float which is a floating Point number so something that may have a decimal number in it might be the player's move speed so I can write move speed colon float equals and then we can say like 2.53 okay there we go so an integer is a whole number a float is a decimal number now you see here how I've written my variables okay they're all lowercase and they have um a underscore wherever there would be a space because in programming spaces are a big No-No okay if you're trying to make a name for something you cannot have a space otherwise that will cause an error okay so in variable here we need to give it an underscore or just have no space at all and this type of code formatting is known as snake case and it's generally considered the general practice when it comes to GD script everything here lowercase with underscores where you would put spaces you can see here with the ready function we have an underscore there and a underscore for the process function okay it's all lowercase now as well as move speed we also have another variable type which is a Boolean and a Boolean is a variable that has either two options true or false so I can create a variable here called game over of type Bull and this can be equal to True okay there we go so game over it's going to be true or it can be false so true or false for a bullying and it's very good for those um things we want an on and off state for example so game over is a good one maybe if you want to keep track of if the player has something equipped um you could have a bullying for that and then finally one more data type we're going to look at is a string okay and a string is text now the way we create a string is a bit different we have to go VAR uh we'll just call this one ability of type string with a capital S this time and this is going to be equal to and we need to put two double quotation marks and we can just put in here uh slash or some sort of ability okay and there we go so the way we Define a string is by using the string data type but this one has a capital S okay unlike ball float and int and to write down a a string value we need to put it in these quotation marks and you can see that with our formatting it has turned into this sort of brownish gold color okay to just note that this is a string now a cool thing about variables is that not only can we read them we can also modify their values so down here in the ready function we're printing out score let's go ahead and print out move speed okay just so we can see what it looks like so we can then press play and you'll see down here in the output we have 2.53 okay so that's all working fine well what we can do is we can change move speed so let's say just before we want to print it so we'll go to a new line here we can go move speed equals and then we can change that to something like five um 0.1 okay so now if we save that and press play we should see 5.1 in the output because we are changing it and that's something else that I need to go over and that is the order of execution okay when it comes to pretty much every coding language there is what's known as an order of execution and that basically means that it runs one command at a time okay in our case lines so when the ready function gets called it looks at its contents and it runs it from the top down okay so it goes move speed equals 5.1 then it prints it out and what we can do then is also go move speed equals uh 500.156 and then we can print that value out as well okay so um what do you think this is going to look like when we press play okay we're gonna have two things printed out and if I press play as you can see 5.1 500.5 or 0.156 okay and that is because we are first of all setting roof speed to equal 5.1 we are printing that value out we are then changing move speed to equal this new number and then we are printing it out welcome back everyone in this lesson we are going to continue on with creating variables okay so in the previous lesson we looked at how we can Define variables up here and give them a data type okay a data type is basically telling the variable what type of value it can hold in our case for score it is of type int which is an integer and that means it can hold whole numbers okay one two three four a thousand ten thousand two hundred okay then we have move speed which is a variable that is of type float and a float is a decimal number okay this can be much more precise in terms of what numbers you can store then we have game over which is of type Boolean or bull we're right here and that is basically a variable which can be true or false okay on or off and then finally we have looked at a string variable which is um a bit which is basically text okay and we Define the value by putting it in quotation marks right here and then down here in the ready function which gets called right at the start of the game you can even see there's a little comment up here which explains what the ready function does uh we are basically assigning move speed to equal a new value we are printing that new value out to the output window here we are then changing the move speed again and printing the new value out to the output and we also looked over the idea of order of execution which basically means that um since we are working with a computer it has to execute one thing at a time okay and in our case with programming it goes line by line so when the ready function here gets called at the start of the game it is first of all calling this line of code then this line of code then this line of code then this line of code okay it goes down and that is a core concept that you do need to keep in mind when writing your code now let's remove this here and let's look at for example how can we change some of these other variables so let's say we want to change game over okay let's just say something happens and the game is suddenly over well we can go at game Rover equals true okay and that is going to change that value from false to true you can then print that out so game over like so save it press play and down here in the output you can see it says true all right now we can also do the same thing for Strings okay and just and to change a string variable it's pretty much the same as everything else we just need to go ability equals and then in two double quotation marks we can enter in a new string for this variable and for this new string let's just say we want to go heal okay a heel ability and there we go so we can then go to a new line print out the ability variable save that press play and there we go it says true and heal okay so as a bit of a challenge I want you to go ahead and create four variables which are going to be used to define a country okay and each of these variables should be using a different data type okay and the four variables that you need to create is going to be a country name a population a highest altitude and whether or not that country is landlocked okay does that country have access to the C so each of those variables need to have a different data type and then I also want you to go ahead and print all of these four variables out inside of the ready function so that when we press play we can see them in the output so have I got that and I'll be right back to see how you've done all right so I hope you had to go at that challenge pretty much what we want to do is we first of all want to create our country name variable and that is of course going to be done by using a string so I'm going to go VAR then I'm going to go country name of type string capital S equals and for me I'm going to do Australia so I'll write down Australia inside of the string variable here all right um now next up we need our country's population and a population that is a whole number so that's going to be an integer so I'm going to go VAR uh population of type int equals and we're going to put about 25 million one two three one two three okay and then next up we have the highest altitude now this is going to be a variable of type float okay because when it comes to measurements you know you can get very fine with those so it's probably good to have that as a floating Point number so I'm going to go VAR uh highest altitude of type float equals and with the highest altitude this here is going to be um 2.228 kilometers okay like so then what we need to do is have a variable for whether or not this country is landlocked and since that is either yes or no we are going to use a bullying for true or false so VAR land locked bull equals false okay and there we go so these are our variables that we have created now the next step is to go down into our ready function here and we need to basically print each of these out now the pass that is here by default this is basically just a filler for the function okay if your function is empty pass basically just is there to give it some body so we can remove that and we can go print country name we can then go print population print highest altitude and then finally print landlocked okay save that press play and we should see in the output here we have all of those variables uh logging to the output which is great okay so we have all that set up now in the next lesson we are going to look at how we can start modifying our variables in different ways and that is going to be done via operators so thanks for watching and I'll see you all then congratulations on completing the course we just finished looking at the fundamentals of the Godot game engine so let's have a look at what we learned throughout this course first of all we learned about the Godot editor we spent some time installing the engine creating our first project and then having a look at what each of the different Windows do and how we can navigate around we then looked at the fundamentals of the engine that being nodes scenes and the tools we can use to move those nodes and scenes around as well as how we can do all of this inside of a 2d environment okay we looked at parenting to get an overall understanding of how this engine works at its core okay with the fact that nodes are the fundamentals of pretty much everything in your game we then took that knowledge and transferred it over to 3D where we looked at creating models applying materials to those models and seeing what each material can do differently from one another as well as lighting xenva is an online Learn Academy with over 1 million students we feature a wide range of courses for people are just starting out or for people just wanting to learn something new the course are also very versatile allow me to learn in really whatever way you want you can choose to view the online video tutorials read the included lesson summaries or follow along with the instructor with the included course files so thank you very much for following along with the course and I wish you the best of luck with your future Godot games
Info
Channel: Zenva
Views: 69,644
Rating: undefined out of 5
Keywords: zenva, tutorial, programming, coding, software development, course, free course, complete course, godot, godot 4, intro to godot 4, godot 4 in 90 minutes, learn godot 4, godot 4 intro
Id: NlzTmL_eB-U
Channel Id: undefined
Length: 88min 4sec (5284 seconds)
Published: Sun Apr 16 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.