Game Development - An Introduction To Unity® For Absolute Beginners | Diego Herrera | Skillshare

Game Development - An Introduction To Unity® For Absolute Beginners

Diego Herrera, Unity & Augmented Reality Developer

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
20 Lessons (4h 24m)
    • 1. What's On The Course?

      2:55
    • 2. How to download and install Unity 3D on a Mac or PC

      10:47
    • 3. Understanding the Unity 3D workspace, gain confidence using the software.

      18:04
    • 4. Understanding the Unity workspace - Part 2

      7:15
    • 5. Creating our first programming script in C# for absolute beginners

      20:00
    • 6. Creating our first programming script in C# for absolute beginners - Part 2

      5:12
    • 7. The Unity asset store and importing your first 3D character model

      19:58
    • 8. Animating Unity Chan

      5:18
    • 9. Creating a canvas and using a button to trigger an animation in Unity

      19:58
    • 10. Creating a canvas and using a button to trigger an animation in Unity - Part 2

      4:54
    • 11. A very quick and simple look at 2D game physics before moving into 3D worlds

      16:06
    • 12. Creating a 3D world in Unity - Terrain with a FPS controller

      20:39
    • 13. Adding a wind zone & making it snow on a Unity terrain

      19:53
    • 14. How to upgrade Unity to the latest version

      1:59
    • 15. Building a car driving app in Unity - Part 1

      19:37
    • 16. Building a car driving app in Unity - Part 2

      19:59
    • 17. Building a car driving app in Unity - Part 3

      18:59
    • 18. Bonus Audio Video

      6:40
    • 19. Exporting to Android in Unity 3D

      15:30
    • 20. Exporting to IOS in Unity 3D

      10:04
61 students are watching this class

About This Class

If you are looking for a free introductory course for the Unity 3D game engine then this is the course for you.

To have Unity 3D and a few example applications on your job profile is an enormous advantage for someone looking to work in this field or improve an existing job position internally.  Linked In recently listed Unity developer as the 6th most posted job for companies in 2018.  I'm Diego Herrera, a Unity and Augmented Reality instructor.

In order to cater for everyone this course is aimed at absolute beginners and I do not expect any prior knowledge of the Unity 3D game engine or C# programming language.  If you are already familiar with Unity / C# and are simply looking to learn a few new things, the later videos in the course are a better place for you to start.  For everyone else, let's get going :)

NOTE : March 2020

It looks like some of the asset store items are moving around as Unity upgrades its software.  The standard assets are now removed form the asset store but don't worry, you can still get the character controller etc from other sample projects they provide and the odl archive is still available if you want to download it here : https://unity3d.com/get-unity/download/archive?_ga=2.118166477.593193274.1585657652-1124525254.1585091718

0d831164

Transcripts

1. What's On The Course?: Hello and welcome to this fantastic beginners course to the Unity three D gaming engine. My name's Diego, a Web and APP developer with over 16 years experience developing and teaching on a one on one basis all the way through to government training levels. If you're an absolute beginner to unity, maybe you've only heard the name on the idea of computer programming scares you, and this is the right course for you. We start by checking out the brand new website from Unity three D for 2000 and 18. We then move on, and we discuss the licenses that are available on I told you, step by step through the installation process. I understand how new software can be pretty overwhelming on its. For this reason, I give you step by step instruction when discussing the purpose of each panel tool and demonstrate their use on three D objects in the world. Never done any programming. Don't worry about it. We start at the absolute basics of the popular programming language C sharp on. By the end of it, I'm sure you'll gain the confidence to continue on your own. Moving on. You learn the fundamental skills needed to animate a three D character. You'll then have chance to practice your new C sharp skills when we apply animations dynamically using buttons on a graphic user interface. After just a few hours on this course, you'll not only have the skills but the confidence to create unschooled a full three D world inclusive of environmental assets, wind zones, particle systems and colliders. You'll also be able to control a three D model car on Drive It Around your World, using a mobile joystick before ultimately exporting toe on android or IOS device. In this course, you won't learn how to build 100 APs, but what you will learn is a solid foundation in the Unity three D game engine. And that's what this course promises. Check out the description of the course on watch. The preview videos make an educated decision on If this course is right for you. I look forward to seeing you in the videos 2. How to download and install Unity 3D on a Mac or PC: Hello, everybody. And welcome to my new course on Unity, the Fantastic Three D gaming engine. Now my name's Diego on in order to sound responding shots because I'm half Spanish. My mom's from the UK on my dad eyes. Family a Barcelona. Now I grew up in the UK and got 15 16 years experience working on applications on around my own company for about 14 years, if not longer. Andi, I naturally progressed into teach it now. I fell in love with unity a few years ago on Dive Steadily Seen it Progress on improved over the past few years on I. I honestly believe that if you're wanting to loan how to build three D games, if you're wanting to learn how to build for Android, for Apple, for actual desktop computers, then Unity is a solid contender against some of the other game engines, such as unreal and things like that. Now unity's fantastic. So this causes put together specifically for people have absolutely no idea on what unity is that may have just seen the logo or heard it heard someone mention it as a three d piece of gaming software on this course is is tailored to those people who don't know anything. So if you already know a little bit, then feel free to jump through the course a little bit later on and start later on after we've installed the software and gone through the absolute basics. But for everyone else, let's jump straight in. So what I wanted to do is your favorite browser. I'm going to use Crume today on I want you to pop across to unity. Now. Unity is amazing. As you can see, this is a new background video that someone incredible has put together. Seuin awesome environmental artists by the look and we have some really cool effects with particle systems for the smoke over near the likes. We've got anime characters walking down at the bottom and up at the top. We've got three D models buzzing around, and we've got light effects on there. This is definitely possible to do everything like this in Unity three D, with a little bit of practice, but why not? Everybody has to start somewhere. So let's download the software on, figure out how to do this kind of thing. So there's two areas I want to draw your attention to the 1st 1 is over in the right hand corner up here. If you click on the icon for the person, then this is where we're going to create a unity. I d. Because you're going to need a unity account now is free to get one on their really good reason. There's a really good reason behind having one, because you have access to an online account on databases. So if you want to create applications that have adverse systems or multiplayer technology built into those, then unity provides a lot of that free of charge. Andi. What within reason, depending on the user's but free of charge. And you need a Unity Idea council that the software can connect about un enable. All those cool features hold fire, though we don't need to create an account just yet. What I want you to do is come down to this magic button on the bottom left and click. Get unity. Now this will take us through to the download page. Right now, it's just before Christmas in 2017 so they currently have a special offer upgrade. If you'd like to upgrade your your free account, which we're going to use today. Andi, get the plus are the pro version on. If you're part of a huge organization, then down at the bottom. They have specific rules for enterprise users. Now, um, a quick overview. The differences between the three different packages. Obviously, that's price difference, but you actually get a bundle off assets included free of charge if you have the plus on the pro addition. Now the prohibition also, hella allows you access to a few more premium features, such as access in the source code of the actual software. But for now, we don't need that. All we need to do is look out personal addition. The only other requirement is that you can only have the personal addition if your company or individually, as a sole trader, you currently turnover less than 100,000 U. S. Dollars. So if you don't have 100,000 in the bank, if your company doesn't currently make 100,000 U. S. Dollars a year on, you haven't used a software yet to create an amazing up. Andi have made 100,000 from the APP stores. Then let's download the free version on get going. So the only other real difference is I have the pro version of the minute. My software will look a little bit darker on the color scheme side, which I'll show you once it's installed on, will come through to the download in, Stolen Now through the download, Install a pick some using the mark asked me to actually download install Heat on. I'll just pop this back up there for a second. Just draw your attention to this sentence. Here, look, it says I'm perfectly fine to download the free version. If I don't currently turn over more than 100,000 now, if you do, then a fantastic be. If you want, you can have a free 30 day trial off the pro version. Now if you're feeling brave down at the bottom, this is where you can get the absolute latest version, which is the beater version. Now. The only reason I'm going to download 2017.2 today rather than 2017.3 is because it's still in the beater testing stage. Antics still bogey. There are still still a few problems, and it's not the most stable. And for me personally, I'm working on many projects at the Mini. And if I if I open one of my existing application projects in the new version that it will actually upgrade all the code on, I'll be stuck with that version. So if I run into any problems, it could cause me a little bit of a headache with deadlines. So if you're feeling brave, feel free to download the beater version. But everyone else let's click on the installer. Okay, so it's downloaded into my downloads folder on as we've Anything on the Mark When I open it up, just get rid of this for a second. I'm faced with the unity download assistant on because I downloaded off the Internet. It's going to ask me if it's safe to run. I trust unity, so I'm going to open it on. Dhere is the actual installer. Now hold on a second because we need to wait on pause after three clicks. The 1st 1 is intro. Then we've got the license and then we are faced with our options on this is the most important section Now. The top one is the actual unity three D software that the editor that's that's definitely what we need there now. We also need something called an I D E, which is an engine that will actually enable us to write code on integrated with the software. So, for example, it's where we will right a script to make a cube spin automatically or a button toe work when we click it. So model developed is the I. D. That comes bundled with you Knittig. Now, if you already have, for example, Microsoft Visual Studio and you're comfortable using that or you want to use something like sublime, then you don't necessarily need one or developed. But I like it, so I'm going to include it the next two. I'd also highly recommend, and we're actually going to need the standard assets. So ensure that the top four Orel selected now the rest is completely up to you guys. Now, if you're going to want to build for Android and IOS, that definitely tickly used to. Now the IOS is a little bit huge. As usual, Apple's software tends to be larger than android software. On the rest is completely up to you guys. But if you already know me as an instructor, on you to me dot com. Then you'll know that one of my specialist areas is actually augmented reality and VR. So now you can download on install the library style, rightly here for of euphoria. So if you've got an interest in a ar VR in the future than make sure this is ticked otherwise you won't be able to use of euphoria augmented reality software as well. Now, I'm not going to go have a big rant about euphoria Ham. You can always check out my other courses if you if you want to. As this this tutorial series doesn't really cover it. I just wanted to highlight that's where it now is on. That's because literally about three weeks ago, you used to have to download the software from view for his website directly. But now, if you do that, it won't actually work. You have to do it this way. So just give it a tick, if that's something of interest to you. Okay, so choose what you want. Make sure you have enough space on then simply continue. It will prompt for my user password on. Then I am actually going to stop on this page. All you guys have to do next. Select the hard drive and click. Continue. But I've already got it installed down here, so I don't want to really downloaded all and overwrite what I already have. What I want you guys to do is click. Continue on then. As the software is downloading with all the libraries that you've selected, I want you to jump back across to the unity website. Here we go. Anywhere. I said come up to the top. Right hand corner on. Now is the time I want you to create your unity I d. So just click this button. Add your name email address on then it will drop you an email. I'm just make sure that you are who say you are then fantastic. Install the software and I'll see you in the next video And we can open up unity for the first time. I log into our account. Brilliant. See you in the next video, guys. 3. Understanding the Unity 3D workspace, gain confidence using the software.: Okay, guys, welcome back. So hopefully you went through the installation process on it. Didn't take a decade to download all the soft, depending on what libraries you actually selected on the Internet connection that you guys have. We're just about to start playing with the unity software. Now, if you cover topics for yet, by the way, if you're using Windows, click on the start button programs on, then Unity. If you're using a Mac down to the application's folder, find the Unity folder, which is here on mine on, then just open the unity up on. If you want to dock it here, you can just click on drag out. Now, if you haven't received your email confirmation yet, don't worry. We can skip through this section by clicking this button here. But if you now have an active account, feel free to punching your email on your password on Let's sign in. Okay, So, like I said, I've already got a few projects open here. You guys will probably be faced with this learned tab, which has a few example, projects that unity have provided on. We've got a sub menu down the side, which I'll let you explore to your heart's content at a later date? Um, but for now, what I want to do is click on New On Once you have created a project, then it will appear in this top. Many here, just like mine do now. If we could canoe for a second, you can see that you can create a three D world or a two D world. It depends on the type of up that you want to do something like cut the rope off Flappy Bird or one of those type of side scrolling games. Then you're probably going to want to be playing with two D environment. I want to show you the power of the three. Decide I want to introduce you to three the game objects, or that's what we're going to use. You can call it whatever you want. Just call mine demo for now on. The other thing I want to draw your attention to is the save location off the file. Now you can see it at the top. I've got Dropbox on. I've also got some software called Sink, both of them a free on. If you know anything about these two pieces of software. It's basically online storage where you can save any any files on your computer, and it will make a copy and story online. Now it's a really good idea to save the projects in the cloud software. So if you don't have Dropbox or Sink, I'd recommend downloading it, because recently this summer, hard drive actually died. It shouldn't have done. It was an SSD drive, but it did. I actually lost quite a bit off work. The majority was on the cloud. But I've learned my lesson on now. About 95% of my work is all on the card. Even my desktop folders are actually short cuts to the cloud, so just make sure that wherever you save it, it's a good idea. If you If you do have it. Teoh, click this button here, these three docks and choose a location that won't go anywhere now. Once that's done, let's click create project Now bear with me. Remember I said, I have the pro version, so mine will look a little bit darker than yours. But other than that, I'm going to reset the actual layout to the default set up So other than the cosmetics. You should see exactly what I'm seeing on my screen. Okay, one second. I'll just put it back to the default. If I click on the inspector in the corner on, they click on louts on the fault. There we go. So other than it being darker, this is what you should be looking at. Now, if I come up up here to the unity preferences on Windows, I think I believe that scene edits on. What I can do is I can show you the editor skin on if I just switch this from my pro version to the personal, you can see. Look, that that's pretty much what you guys should be seen. Now. I'm used to the pro version, so that's the one I'm going to use. Okay, so let's let's have a look around the software and figure out exactly what everything is now on the left, on the right, on down at the bottom, the so called panels. They do different things, and if you move the mouse, hell, you can expand and shrink each panel to pull the actual work space around. We have usual file menu system about the top when we want to create objects on down at the bottom. This is called the Project panel. This is where everything that we import on all the files that we save, they'll all appear here now, left to right, then this is the hierarchy on what the hierarchy does is it shows me everything that is in my scene. Now, this is the scene here. If I just right click on hold the mouse, I can pull and look around and you can see that this is actually a three d world. So over here, if I use the middle mouse button to scroll across on the right mouse button to turn look, you can see my camera. Now. The left inside is showing me that we have a camera on a light in the scene and there's nothing else there, which we can see now. If I zoom up for a second, you can see these grid lines. Andi. That's how we can identify the coordinates off all the different game objects. Aaron Art scene. If I click on any item in the high rocket, that's how you can select it on depending on what type of game objected actually is. If it's camera, for example, it will show me a preview off the camera here. If it's a light, then it doesn't have anything here. But we can see a preview off the direction that the line is facing now in the middle. Then this is the scene on then across to the right. This is what's called the Inspector Now. The inspector gives us all the information for the game objects that are in the scene. So, for example, if I click on the camera, then it will tell me the position off the X Y and Zed coordinates. Now that's relative to this little widget here. So X is going across why it goes up and down on that goes forward and backwards. Now, if I come up here to this menu on it creates our first game object. I can explain this a little bit easier. What I want to do is click game objects down to three D on to create a cube and that's war place Cube in our three d world. Look, if I just zoom down for a second, have a little bit off a closer look at our cube. You can see that where the Cuba is relative to the camera, never click the camera. We can now see our cube. Look, if I click on the cube here or I click on the Cuban, the hierarchy, it Andi, I choose this tool here, which is to move. Then I have what's called a transform on that is relative to this inspector component. Here, look So we can see that the position in the world is pretty much zero. This is the center off the world. If I zoom right out on you can see that we have these three axes. We have an X, which is the red one. Wherever. Why? Which is this green looking yellowy colored one on? We have a zed, which is a blue access on their represented here. Now, if I were to click on this blue arrow on, move it, then it would move just on that access. It would just move on. The said on you can see on the right hand side in the inspector. Yeah, gives me a live preview and updates showing me the new position based on the grid off the world. Now, if I cook on the camera. Now that's a cubes closer. You can expect it to be larger. Look in the scene. I can also do the same with a camera. I want to move the camera. Now Look, we can see how the camera is affected. Moves up and down on the wire access, or we can move closer on further away to the Cube with the set Onda. We can move across site aside with the ex. So that's what the inspector is doing it showing me information about the selected object that's being clicked in the hierarchy. It So I come back to the Cube. Look, you can see that the inspector switches to be the cube on the transform information off this X Y and Zed Co ordinate is automatically updated when I select each item. Okay, so let me show you how the rotation works. Let's say I wanted to move the Cube. I can click on the arrows and moving around. Or if I come up here, I can type in a new number, and it will automatically jump to a different location. Or the third option is if I just move my mouse. Look in between each one I can actually click and drag. I move around that way as well. Now imagine on these coordinates of this X y and zed that effectively, these were like a poll going directly through the top to bottom this face, he and coming out of the bottom on the white on, If I were to stab a pole through the side, that would be like the eggs on. Finally, if I had a poll coming through this face in the centre, through the Cuban out of the back, that would represent Zed on you can see that if I were to grab ahold of my imaginary kind of pipe, Andi, I were to twist it. So if I got hold of this ex and I were to turn it, then look what would happen. Look, it would actually make the cube rotate. So all I'm doing at the minute is holding my left mouse button and I'm moving the mouse to the left. You can see that it's rotating and show me the degrees that Cube is actually rotating on. Now, if I just put this back to zero just like that, I can give you guys an example of how the Eddie the inspectors transformed can turn on the why access by just clicking in the center here on rotating. So it's is if I were holding his pipe going through on the Y axis and I would just decided to turn this pipe with my hands on it would twist the object. Look now, later on, I'm sure you have to do this with Cold, where we'll actually write a piece of cold that will grab ahold of the transform, Grab ahold of the transform and dynamically increase this to make the cube spin or by itself. Now, if you move everything around, I'm really mess everything up like this. Then there's a magic button here, and if I click the cog I can reset on that will put my Cube back exactly where it first appeared. Okay, so there we are, moving back over to the comer again. So what about if I want to make another cube? Well, of course, you can click on game objects. And three, the object to make another cube. There we go. We have to. You can see in the hierarchy. Look, It showed that we now have a second cube if I want to rename A, I could just simply rename the cube pressure Turn on. It will update the hierarchy. It I Likewise, I can click here on rename this as well. Just like that. On that day, we can actually identify with a more recognisable name for each element inside our scene. Now, one thing that you can do to remove an object is just like any native software you can right click on its name in the hierarchy on delete. Or you can just simply hold command on backspace or just press the delete key on a windows computer on that will remove it. Just do that for a second on. You can also click Edit on delete that way. Now, if I want to move to at the same time, I can hold a command on a Mac. Ah, now I can move while both are selected, I can move this way. You can't click and drag, um, and highlight this way on effectively get what you want, because sometimes objects could be kind of inside of us and you might accidentally select on object. For example, the light or camera something that you've forgotten exists or something's been spawned. So it always recommend, is a good habit to use the hierarchy. Artists like tonight and before you do anything to it. Okay, now there's also something called nesting using the hierarchy. Here, I can click on the second coupon drag and drop it on top of this 1st 1 on effectively. Now this first cube has become the parent off the 2nd 1 So if I move the parent, then the child will cope with it, which is very handy for, for example, if we have a bunch off trees, for example, and I want to move the entire set of the trees, then I could make a game object to make all the trees a child off the parents game object on that I could move Bunches of trees together or even if I wanted to, I could right click on. I could duplicate the entire family. I move that across, and that's really handy in tip to creating vast amounts of objects in a very, very quick manner. Just delete this for a second and just tidy up now. Another thing is, if I click, my child underst moved inside. Now look it may be a little bit difficult, especially for put it right inside. Like so. It's got to be difficult to actually select the child mouse, why I accidentally messed it up. So what I can do here is I can cite the child here. I'm just bringing back out again. Just like that. Now, if I want to make a knob jek bigger or smaller, then in the trumps form here I can mess around with scale on in the same way I could just simply increase the numbers are aken click and drag on the X, which will make it wider on the why which make it. Why doing opposite direction Taller brown on the said which will make it deeper Now, another way to do that is up on the left hand side. The 1st 1 is just to move around the scene. The 2nd 1 is to move objects. If you roll over, it will actually tell you what each one does. The 3rd 1 is to rotate so we get a sphere like this. Look on we get colored lines to represent the access from the transform. I don't necessarily like to do this that much Sometimes I find it a little bit awkward to use, so I prefer to use the transform directly to mess around with the rotation of an object. Put that back. You know, on the last one appear that I'm going to look at right now is the scale option. So this provides us with a small cube at the center off whatever three D model that were using. And if you click on it and drag, you can see that it's actually made the game object larger on the transform scale has increased to represent the new size. Now it's OK saying this East three on this is 2.43 What? And 2.4? What if I just reset this for a second? I'm just moving out again. What I want to show you is the grid itself. Now, if this were right down on the actual grid, you will see the size off the square is actually one regularly on. That is the default scale. Look for our three d world. So if I were to increase this to on all of the access and we now have a cube now is larger on Fitz pretty much on a two by two African, actually, the commerce out slightly for me. But that's just to give you some kind of context a basis on So now we have a Cuba's pretty much well. It is twice the size off its parent category, so it's a it's a little bit of a chunky kid. Okay, so how would we reset that again? Let's press the magic reset button on. There we go. So let's just delete this and have a look at a couple of the other game objects that we've got up about the top. We have all the base ones for any three D kind of software. We've got a sphere here so we can have a nice a nice glow because made that a little bit bigger. There we go. I move it up. Moving around. Look, if I click on the camera, we can see both elements inside the camera 4. Understanding the Unity workspace - Part 2: you can also have capsule there. 100. We use these for lots of different things in in games, Normally we hide them. But throughout the initial process, we could use these as Marcus for, for example, in a way point system where we place waypoints around on. Then a character would follow that path would actually hide the capsule. Okay, I always bring him back across into the view here like so There we go. We've also got a plane which some people like to use for the actual ground, the surface. And you can see that the directional light is committed to play now as it's casting a shadow for click on that. If I moved the light, you can see how the shadows will move based on the direction that like, it doesn't matter where this is in the world. I can move this right over here is the only object that really doesn't have any effect on its actual position. Within the world is to see it like the sun casting light from one angle. But if I were to move that on, say the ex access, but you can see the shadows will move in relation to the position off the directional light . Now I can also change the color of the light by clicking here on this will give me the normal kind of pop up. We could mess around with colors. There we go. Okay. So, to the game objects, a plane can also be used to be used as a background image. So if I were to just simply twist this access again, this this X access by minus 90 and stand it up, then we can see from the cameras point of view. Now we kind of have a background on if I make that bigger like so and then look at the camera, then he actually gives us a background image on. I can then apply a texture to this, which could be an image off whatever I want. And that would be how, for example, a two d game can be put together in a three D environment by faking, really? Just put in an image on the background. Okay, now, that's just a brief crash course introduction into the different game objects on what hierarchy is on. What they inspected us so down at the bottom, then we also have the project on the console. Now, if I go to file on, save this scene, save the actual up. If I expand this for a second look, you can see that it's actually inside my assets in my demo, which is inside my Sync folder. If I just saved this seen as the main scene, then that's what the project panel will do. It will show me all the files on all the assets that are related to this, and I have saved the scene. If I wanted to open this or I'd have to do is double click on it will recreate this environment. If we go and create a new scene now, everything disappears. But if I want to go back to what I just saved, I just double click on. There we go look. So, for example, this could be the main menu screen on. Then we can create a new scene for the actual gameplay scene on another scene for something like the high scoreboard conceived them individually. Now, if I click on this on, I go to it in my finder, you can see that actually created a unity file in the correct folder for me inside my Sync folder at for my project. So that's what the project panel does here. And as this grows all the time, then will create folders inside it to store all that sound effects to stall all the game objects to store all the images that we're going to use and character models and things like that. Okay, so that's what the project panel does. OK, so that's the hierarchy covered. We've got the scene covered, which is actually our game environment that we can see and move around. Remember, it's a right mouse button to move around on the middle mouse button to zoom in and out, and the left just selects on the objects. Now on the right hand side, we've got the inspector that appears and gives us information on the object that we've actually selected. We can create new objects up here in this menu. They will all appear here. You can drag and stack them on top of each other to make them Children. You can right click on delete on, then everything that's on the scene if you want to save it, will then be saved in the Assets folder inside the project. Now, the only time left that I want to touch on right now is the game tub. Now, if you can't see that become window on, you've got the game here on it. That works the same for any of these panels. Just window and open it up that way on what the game does is it will actually show us what it will look like on the actual device Once we've exported this through the eyes of the camera. So if I click the game and we don't look, this is what it looks like through the camera. Now you can't click and interact with any of this. It's simply just to the visual representation of what the camera can actually see. Now. If we had attached some cold, which will do later on to one of these objects and the cold would make it spin, then in the game, you you still wouldn't see that happen unless you click the play button here to actually run. The software, which will allow the court to work on this cube, for example, would rotate, or we could maybe move the light or change color. Okay, so to show this on a professional level. For example, if we jump across to the Unity website, even though we're nowhere near this level us at the moment at least you could understand the concept. If we look at the game view here, it has three D objects. It has a camera, it has a directional light and has a three d world. Now look at the website again. We're now looking through the camera. It's got some cold and it to move the camera across slightly to the right on. They've created a bunch of three D objects which all have a script on individually to actually move them around. They've got directional lights, they've got a few particle effects and some systems on you can see just how the actual environment is put together. Granted, they've done a hell of a lot of work on textures, lighting and everything else. But at least you understand the base principles. So, looking at our masterpiece right now, then I'm sure we're going to get to that level in no time. Okay, guys. Well, that's enough for this introduction to the workspace. In the next video, we're going to actually start putting together something really? Some really cool tools. So I'll see you in the next video 5. Creating our first programming script in C# for absolute beginners: Okay, everybody, welcome back. So today is the day where we have a quick look at the programming language. C sharp now unity users scripts in either see shop or JavaScript on the one that we're going to be looking at a c sharp. Now what I want you to do is come over to X is new on click, and we're going to create a new project. I'll just call mine. See Shop, African Spell, See shop. There we go, Andi click. Create project on Dhere We go. Unity has opened up a default new project for us, so we have the main camera in the direction of light on pretty much nothing else. Now what I want to draw your attention to first is the consul panel, which for me is down here. If you can't see it, you can always click window and go down to console on. It will pop up somewhere if it's not in the same place. You can also click layouts and click default on the console Tab will reappear now. This tub here allows the script to send us messages throughout our development process so we can write little messages to ourselves. checking a score or checking the time in the game or the distance between different objects or whatever information could be useful to us for debugging. Now what I want to do is go to game object on. We're going to create a three D Cube, and now what we're going to do is we're going to attach our first see sharp script to this cube on. We're going to manipulate either its position or its rotation in a second. So there are two ways to do this. You can either on the Project panel, right click and create a C Sharp scripts. Or there's a quick away where, while the Cube selected, we can add the script on this ad component button Sophie Click on I'm just going to Type Cube script. There we go on to create an ad. Now what that's done is it's created another little one of these boxes, which are called Components on its automatically attached the script, which has also appeared in the assets panel now, and that's attached to this cube. So while ever the Cube is actually active where it is in active or active, the unity software will run any code that's attached to every game object in the hierarchy that has a script Now. The software used to edit the cold that's bundled with unity is called mano develop. And if you just double click on the script, that will automatically open this script inside Model developed software. Here we go Now. What it's done is it's generated for us. The default script is trying to help us, as the majority of scripts rely on these three lines at the top on. Then we have something called a class. Now these three up at the top are actually libraries full of many functions. Now imagine if the software were Microsoft Word, for example. One of these would be for funds, for example, on some of the cold would say, If you click on the B button on the software, I want you to access the function inside one of thes libraries. Get hold of the tax on making bold. So these three libraries over the top contain the majority off the base functions that people use for general coding in unity. Now, to give you a quick crash course for a second, the code starts with something called a public class on. We give it the name off the file. Mano behavior is an additional library for mono developed the software that unity and stands. It also comes with these two blocks of code. Now a cold block is opened with a curly bracket on its ends ends with another curly bracket on whatever's written inside is the code that's executed, so every every script when it first starts starts off with a start function andan update function. Now every script that we generate in the manner that we did earlier on with immunity comes with this default cold on. Because where, including libraries are specific to the software unity, Unity will know what to do with a function called starts and a function called updates. Now the start function is what run a soon as I press play. So for click the play button, whatever is written inside that start function will affect the Cube. Now we don't have any cold written their office. Listen, nothing's happening. The difference in that on the update function is it says, that it's called once per frame, so this will run over and over again every single frame. Now imagine that you were looking at a filmstrip on a timeline. The software, when you exported to a nap or exported toe, export the game to a desktop, for example, or run between 30 on 60 frames per second, provided it's been optimized. That means that whatever cold is written inside here will actually be executed up to 60 times a second. So what I want to do is I want to click inside the start function, and we're going to use an inbuilt function called Debug on. We're going to log a message. Now. I'll explain what this is in a second for now, just just copy me and then we'll go through this. So I'm going to write the word started inside the D book log. Then I'm going to write again underneath Andi. I'm going to write inside quos, updating now. If you save the file on, I'm just going to move mono, develop across to the side on switch to the console inside unity. Now, whatever I write as a debug, which is an inbuilt function, it will log a message whatever's written inside the quotes to the console. So because we have this script attached to the Cube. When we press play, whatever's written inside Start will be executed so we can expect the word started to appear once on then, while over The Cube is active on the scene on the script is attached to the Cube. This update statement will run between 30 and 60 times a second as it runs once per frame on, we can have up to 60 frames a second, so we can expect a message to be written here, over and over and over again. So make sure the file is saved. Come Backed unity on hit play. So down on the console, we have a stark message. That's a started that's occurred once on now, the update statement is looping over and over again, while ever the Cube is active so we can see the message. Updating is getting written repeatedly. Now you may not have this in two lines. Yours may actually be down the page like so where the message is repeating over and over again. And that's simply because I have this little button here that collapses the the function for me. So any message that is exactly the same will be collapsed, and it will be incriminated on the right hand side. If you can't see this at all, makes you you have this button pressed here, which will show the D book messages. Okay, so there we go. Now you can see how the script actually interacts with the console, and we've written a message onto the script. Now let's jump back across to the script for a second, and I'm just going to go through what this actually means. Now. De Bug is a built in function. If I write it again, we can see here. Look, it's a class containing methods which functions on the AIDS us with debugging the games with specifically written to write messages to the console. When I press for full stop, I can then go inside, and I can access the different properties off this function on then to write to the console . The one that we want to use is log to log a message, and you can see here that he expects brackets after the word log on, then the message to be written inside. So if I open up with a bracket, it now tells me that I need to write the message on is asking for something called String Now a string is a sentence or phrase inside off two quotes. So whatever is written inside is classed as a string, and this can be new miracle or text based. Now, after the message, we can see that it expects another curly brackets on. Then what we do to finish the line and tell the code on the system that we finish with the line is to add a semi colon on. That's what's known as the basic syntax or the grammar really off the programming language where we will write a function on. Then we will pass in parameter that the function requires on depending what type of parameter it requires. This area here will change. Okay, don't worry. This this we're going to be doing this a lot, and it will all make more sense when we put it into practice. Now what I want to do is come up into this area here because what we have is the public class, which is the script for the Cube script, and you can see that it opens here on it ends here, down at the bottom. If I just click there look, you can see how the software shows you The opening and closing areas off this actual classes is kind of like a group of functions on. Then inside the class, then you will have individual functions. So you could see this as, for example, a book on. Then these would be the chapters inside. So what we can do is we can add additional chapters to our book. If I wanted to add a new one, which I could call press the button, for example, then all I have to do is is follow the same kind of rules as a function requires an opening and a closing bracket on. Then open up what's called a cold block on, then close my little section on. Then this will be a new chapter in the book. This now means that whatever I right inside will be clusters the pages off that chapter on . If you were to turn it to this chapter, this is the code that will be executed, and you'd expect to see have an impact on the scene that you're viewing. So I just delete that for a second, and it's just gibberish for demonstration purposes now What I want to do is come up to this area here on. I want to show you how we can add some additional variables to this this class on. Then these functions will be able to use these variables on manipulate their values. So variable you're probably thinking, what's a variable? So a variable is simply a name of an item that has a value. For example, you can have a variable that's in number Andi. That value could be a number one on. Then the cold could multiply that number every second on it would be able to dynamically override this variable Andi change its value. So, for example, you can have public on private variables on what I'm going to do is something called an integer. Now it's referred to as on int meaning integer on. Then all I have to do is give it a name. So, for example, it could be my number. Could be the integer on. Then I could assign it a number one. Okay, so now we've declared our first variable. We've chosen that we want to make our variable an integer, which means it's a number essentially whole number on. Then we've said our variables name will be my number on I've assigned it the value off a number one. So let's create another one and let's have a public integer on now Call it my second number . Andi. I will assign that the value of 10. Now, if I wanted to choose a number that wasn't a whole number, then I would use something called Afloat. Now afloat has decimal points. Andi is followed by the letter F, so my floats could be five andan f on. Then we close the line again with a semi colon. Now, because these are inside the class but not inside a specific function when they're originally created, these functions will be able to access all these up at the top on. You'll see as the page grows with multiple functions, how we can manipulate the values. So let's jump back to the update statement for a second, and what I'm going to do is I'm going to write another message to the console, and it was basically say my number. Now. Whatever is written inside the string is or I decide I want my message to be into appear here, but what I can do is I can bolt one of thes variables onto the end of my message for about a space here, for example. And then I write. Plus, Andi, I'm going toe add my number and it knows exactly which variables are accessible now. Then we can expect the message here to read my number. And then we've added my number variable onto the end of our message. Now it's not inside the quotation marks because this is a string on. This is an integer on. We're just adding it to the end. Now, the debug lark is smart enough to know what to do. This is called overload, in which we don't need to worry about too much for now. But I'm just showing you how things connect to each other. So if you just save the file and go back, I'll just clear this off for a second on that. If I press play now, the update will run up to 60 times a second aunt. Here we go. Look my number and then we've added onto the end the number one. Now, if take collapse off, you can see that they says, recurring over and over again. as the update statement runs on, it works in a similar way. For example, hypothetically, I could have some called here that says, If my number is one, then I want you to add 10 onto it and then write that message to the screen. Or if the time is less than 10 seconds, I want you to add my number together, over and over and over again. Until it matches the amount of seconds or something like that. You can just see generally how this kind of cold comes together. So this here is a string. If you remember inside the quotes and we can also declare those up at the top will have a public string on. I will call it My String and that will equal a string in between quos. So if I write the word happy inside there, for example, now this is a string. I don't have to write this here. I can just simply write my string on the cold will use whatever the value off my variable ease on dynamically writing into the update, statements are safe again on we will have happy on, then a number one afterwards, in the deep oclock. So I just press play on that. We go happy one. So you can see how this script can dynamically access these variables up at the top on the we can make things happen based on what these values are. So if we put this into practice in the real world, one of these would be, for example, the score for the game. And because it's public, that means that other scripts will be ableto access this variable. So if I added public variable, which will be the score, for example, and set it to be zero, then we added a second cube or scoreboard on the scene. Declaring this variable as a public variable means that it's exposed to other scripts within the software so we could have a second script that can access this value. So let's Imogene on the screen. We have a scoreboard, for example. On there's an empty box where the school would appear. That box could have a piece of script attached to it on. It could simply say, Jump across to the Cube script on access the score variable on, write it into this box. Now the difference in a public on the other one, which is a private variable. If I write my other score on my temporary school equals 100 for example, because this is private. That means it's on Lee access accessible to the functions within the same class. That means that if my or the script on the scoreboard tried to jump into the Cube scripts and access this variable here because it's private, it wouldn't be able to see it. And that's called scope. So that's the difference in a public and a private variable within unity. There's another difference Where, if remember, this is on the Cube. If I click on the Cube, anything that's public appears underneath, down here on, that's good for us for debugging, because I can dynamically change these these numbers here on when I press play that will be . It will override the Cube Andi. It will inherit the values off variables will inherit the values I've assigned here. It's really handy for testing out things like altering sizes. Or maybe if we want to adjust the speed slightly or something like that, we can actually just tweak it here, press play again and see our effects. We don't always have to jump into the cold to do that. But that only works with the public. Variable. Okay, so that's the difference in a public onda private variable. Andi, I've introduced you to an integer afloat on a string in Tages phone numbers, which are whole numbers, floats off in numbers of well, but they have or can half have actually written whole numbers well, but it could have a decimal place like so a string is for and capture Lee to text or text and numbers and symbols or whatever you want. 6. Creating our first programming script in C# for absolute beginners - Part 2: on, then underneath we've got a public and a private integer on. The difference is that the public one is visible to other scripts on the private. One is only available to be used to these functions on the private variable is only available to be seen inside this particular class. So only the chapters off this book will be able to see on access that private variable on. Then you can see inside here how we added two together and then wrote that to the console. Now the last thing I want to show you is how we can access these components. So what I want to do is get hold off the game, object for the cube on. I want to access its transform on. Then I'm going to adjust either the position Are the rotation on the update to make the cube spin, remove a little bit of white space and you can see here where I included the model behavior class. That's another class that's full of other functions and a quick tip. If you hold control and click, you can go to the declaration and actually inspect this class and see all the different functions that are inside it. So here's the the model behavior class, and you can see all these functions inside here are built on DCA necked and so that when we start typing things here, we can access and run all those kind of tools. I just take this out. Just minimize this slightly so we can see two things at once on the updates. Remember, this script is attached already to the Cube, so it knows which game objects on referring to. So all I have to do now is access the name of the component that I want to actually access . So if I wanted to access the transform, I would simply right transform on. Look, it says that I can get the information off the transform attached to this thing's game object on. Then I can go inside with the dot and I can access the different things I want to actually mess around with on one of the things I want to Max with initially rotates on. Then it say's that expects a Vector three, which is an X y and zed co ordinates. So there we go. So now I have to give it an X y and zed value. So I'm just going to rotate it on the X one. Andi, then zero on the why. Meaning? Don't change this andare put zero on the set as well. Now, what will happen is on the up day it will actually move my cube 11 point. Basically, every time this update statement is called, which will effectively increase this number. So now if I press play, the cold will run on this. X value here will increase every time the cold is run on. It should spin the cue for us. So let's have a look. Here we go on. There we go. Look, and you can see the rotation is increasing over and over and over again every time the update statement is called. So what we've done is we've used code on. We've gone through the transform to dynamically change one of the properties on because we put it on the update function or inside the update function. Actually, this is called over and over and over again to increase this value every single time. They said this cold is run. Okay, so that's a quick crash course on inter juice and floats and strings how you can see them externally in how you can have private ones that are only inside this particular class, how you open and close a class, basically creating a book off, hypothetically speaking on. Then we can have numerous functions inside which have this structure here, which we decide what type of function it iss the name of the function on. Then we open and close the brackets on, then open and close. The curly braces on whenever we put inside is run if we call this function, but the start of the update are the default functions are included free of charge. Every single time we create a new script through unity. Okay, so hopefully that makes sense. Don't worry if you've never seen this kind of thing before. As we go into the next few lessons, you'll be doing this over and over again and out for the first few lessons. Definitely, I'll be explaining exactly what we're doing until we've done in a few times on You won't need. You won't require my my systems on the area. So let's let's close unity. Okay, I'll see you in the next video 7. The Unity asset store and importing your first 3D character model: Okay, everybody, welcome back. So now it's time to have a look at a fantastic resource to start loading in some assets into our unity Seen are making the most of the software. Now, here I am again on the unity three d dot com website. What I want to do this time is go over here to where it says asset store. Now they come, huh? On this will take us through to the online community portal where users can download assets . Some of them are free, some of them are paid for on. You can get everything from three D models to first person controllers such as this. You can get something called a make anim system, which will allow for character movements. You can get textures, skyboxes, audio files. The list goes on. A known unknown. Now it's laid out similar to any other kind of app store, where it has a few featured ones in the middle. On the right inside, we have a few categories on. Then if you scroll down, it's got the usual suspects of things like the top paid assets, a top free assets on things like that. Now, as you progress and you get better. Better unity. Maybe in the future you would like Teoh release your own assets. And if you wanted to, you can sell ourselves by clicking this link here. Okay, so what I want to do is I want to go into three D models because this is the first area that I want to show you. Andi, I want you to click on characters on, then click free. Okay, Now, here we have 241 pages full off free assets. Some of them are much better quality than others. Some of them have animations included some of them. Don't you have to have a look for the kind of thing that you're after on? You can use the filters up at the top, if you like to to filter through and find the most popular aero or the money that's being updated most recently. Now the one that I want to look at is Unity Chan. Now this is a cartoon version off the what's actually the thing is a logo off. Unity in there in Japan, on this character unity Chan has got loads of animations included. All you have to do is basically activate them using the software. So I thought this would be a very good example to use to be able to understand how the animation controller works on. Then you could swap the model. You could reuse the animations for different characters. If you like Teoh on it, it's a good foundation. So how do we get this model then? Well, there are two ways I'm logged in at the minute on the Unity website. That means that when I click add to download, it will add it to my downloads here on. Then, if I click on downloads, you'll be able to see the list of assets that I've downloaded recently. Okay, so we have a bunch of assets that I've got in my list. Now, if I want to, I can click open in unity, and this will directly open the asset store up inside unity. Now, I'm gonna show you a different way to do that, though What I want to do is add unity Chan to my downloads list like so except okay. And now the model has been successfully added to my download manager. Now I like doing this on the actual website I like the size of the website, and I like to be able to see everything on a nice big screen like this because sometimes, especially from buying an asset, I like to come down and check out all the reviews and things like that. Yeah, this basically is not for commercial use, as the reviews are saying, so we can. We can use this to play around with, but you can't put this actual model in a game, but you can use loads of other ones now the raise. The reason I added this to my downloads list. If I just come out of this for a second on I open up Unity on open up a new project. Here we go. Okay, So now Unity has decided to give me the example. So I'll just call my demo scene Chan. Everything else could stay the same for me. Now. The reason I showed you the website first is like I said, I I prefer to look around the entire thing, but there's a shortcut method to do exactly the same as what I've just done from within unity itself. If you click window and go to asset store or if you're like me and he already appears at the top here, just simply click a tub on that will connect through. Unload the Web page within this little window. Yet now you can pull the tub. Andi, remove it from being docked from the list and then expand the window. But I prefer to find the assets on the website on Add them to my download manager because this magic button here look will actually link through to my download manager on because I'm logged into my software. The two accounts are synchronized. Andi, I added Unity chan via the website. So now I have access to download and import the asset directly into my project, which is kind of cool. So I clicked. Download. Here we go on. Now it's downloaded. I can click import on. This will open up the import manager within unity where I can select the parts of the asset that I want. Okay, so here we go. This is importing the unity package. It's broken down into the animation. You can see there's a lord of different animations here for the different polls is like jumping and running on waiting around walking around. We've also got some allegations down here. We've got some materials for the actual model itself. But I'm happy with this one. Let's just import everything. So here we go. The assets will import and will be dropped down the bottom. Okay. This this does. I believe it does come with a demonstration. Seen. I don't want to use that. Where we go, it's loaded in the folder on here. Look, we've got a scene here. We have different demonstration scenes. Now, You guys feel free to have a look through those air. Really? Well done that done by the actual unity team. But I want to give you a solid foundation. So if you look through the folder structure, we have one here for animations on. We have one here for models, and that's the one I want. So I just go back to my scene. What I'm going to do is I'm going to create a game object on. I'm going to make a cube, which we're going to use us the ground on, then on the Cube, where it selected our scale. This to about 20 on day 20 on the set. There we go. So now we have. Well, I'm using a cube. Like I said is the actual ground on. The reason for that is because it comes with something called a box collide, which will prevent items from going through it. So what I want to do now is place the model on top of my box. Now, before I do that, though, just to make life a little easier if I go into the think it's a stage. Yep. On go into the materials, I'm going to drag one of thes materials on placing on the Cube. Give the Cube that material and you can see Look, it's got all the way around the material. Now we all you have to do is drag them out and drop them on like this. Look, well, that's actually doing If I could come a cube for a second and look at the Inspector down here where it's got the mesh, which is actually the the model itself. We have got a material applied down here on. If I wanted to swap that, I could click here, Select on. It will bring up all the possible textures I can use as a material for the ground off this cube so I could use things like her hair color if I wanted to, or any other parts off the model that is being included as an actual texture. But for now, I'm happy with this one. Okay, well, that's enough about the Cube. For now. Let's jump back up through the breadcrumbs. Here. Look, I can click on Unity Chan on it will take me back up and then I'm going into the models. Aunt, here is our Unity Channel model. Now I can click on drag on her and drop her straight into the scene on She will appear wherever I let go like so, but to make life easier, what I'm going to do is drag her onto the hierarchy like that. And that means that she will be positioned exactly in the center for click on the camera on bring the camera a little closer to her. Here we g o. Then we can see the camera. If I just moved the ground down slightly, that's all. Switch to the game view for this. In fact, I think I got it. I think I got it about right. Just make sure she stood on the ground. There we go. If I click on the camera mark selected Look, just going to move It barks slightly up a little bit on then on the red, the the ex access. I'm going to use the rotation on just tilt it down. There we go. And if we look back now that she is. So if I click on Unity Chan on on the rotation on the why which goes straight through ahead and out of the feet out to a quick 1 80 that we go she's facing is now. So here we have our first model. Now if I come back to the scene and just move across to her for a second, So we're looking pretty much where the camera is. The way that models are set up are broken into different sections. Now, Now I have selected unity. Chan at the top is everything. But if I go into one of the sub menus, then look, you can see how she's broken down, and this is how you could select a different element or parts off a model on if you want to to hide it, you could click here or if you wanted to change its color, you could click here or change the material so you can change the clothing. So if you found this material in the actual folder structure, you could open that in photo shop and change the colors as a make a copy. And then you could create an additional character with a different color texture. Now, every models different not all of them are broken down this well, if we go to this area here, this is more common. So this is kind of an additional area that the guys have done on the Unity Chan model. This is more common. This is how the two legs spying from the top to the bomb Exactly on. Then the legs and the skirt are broken up. And this would be how we would be able to select individual parts off her body on either change the asset or change the color or apply an animation to each one. Now, Unity Chan already comes with a load of really cool animations. But just because we've downloaded the model doesn't mean that unity knows what to do with it straight out of the box. If we click on unity Chan here you can see that she has an animator attached to her. Because she's a three d model, however, is missing something called animator controller which would be dropped in here Now the animator controller is what unity users to know how to run and position and move thes different parts off her body. Now, if we come to unity charge again on go into animations here we can see that she has a bunch of different animations. For example, uh, this one here is pose. All I'm doing is clicking the arrow guys, by the way, and it will expand all the different assess. Now, if I drag this bop slightly, then these are the actual animations. These are the little the little play button on you can see. Look, the name appears over the top on here because she is a humanoid character. Then these are associated with the unity humanoid model on post 29 for example, if I press play will show us what happens. So let's find something cool like one of the idol states. Um let me just have a little weight too. Wait three. Let's have a look in the animators no. So just to see the animation, you'd simply press play. Okay, now he's not really animating properly, but that's because it's just a preview. But what I want to do is I want to use this, apply to the model. If I press play now, nothing will happen. There we go now she doesn't have. If you click on her, she doesn't have an animator attached. If you're wondering, by the way, while my screen has gone slightly blue, that's because up in my preferences I've changed the colors for the play mode tint here to be a blue so that I remind myself, basically, when I'm looking at the play mode, and the reason for that is because if I make any changes while the game is played as soon as I got back to the normal state, all those changes are done on. It reverts back to before I press play. So it's a good little trick to change the color of the play mode so that you just remind yourself that while you're playing the game, whatever you do at that point will not be affected, will not fake project once you come out of play, mode anyway. That said all what we need to do to make a move is art an animated controller. So let's come back up to the top level upsets. Right click. This bottom section on creates an animator controller. OK, I'm going to call this my child because it's my animates it for the unity charm model and then going to click on Unity Chan on. I'm going to drag this across into here. So now Unity can use my file onda access the models sections off the body which correspond to the animations inside without being provided. Now to view that, what I do is I click on the model which has the controller attached, and I go to window on down to animator. Okay, that will bring up this panel here. Mine has appeared next to the assets, which is fine. I'm used to being around this area anyway. Now, if I use the middle mouse button or believe the short cookies M, I can click on, move this around Now the entry state is the default for an animator on. Basically, there's nothing associated with this Unimatrix Brown brand new, and there's nothing to do. So when we press play, we look at Unity Chan. Oh, and she's moved. But that's not a problem way go now. So what I want to do now is I want to choose an animation on drag that into the animator and make it the default state so that instead of just standing there or dropping through the floor, which characters currently doing like so then, basically, I want the character to go straight into one of thes pre defined animation. So if I just find, wait to, for example here and I click and expand to that animation, that's what I'm actually after here. Now these are just the parts off the model that reflected on this is the Avatar that's going to be used to apply the animation, too. So if I click the animation drug out here, it goes orange. And that means that the Unity Chan character now has an animator controller on the Unity software understands that when it enters the play mode, then it wants to go straight into the animation which will apply to the model Andi. She will do something like this. Here we go. Look, there she is, She's animated and he can see head back in the eyes, the different parts of the model here, or what are being controlled by this animation clip now without going into it in too much detail. If I go to the window and go to the actual animator now, go to animation. Sorry. If I select this animation Onda, we open up the animation, you can see all the different key frames that have been used to actually create this animation. Now, when it's something this complex, the animations probably being captured using certain mo motion sense a suit, to be fair. But this is obviously a more advanced topic, but I just want to give you tiny, tiny understanding of how this actually works. If you imagine this as a camera film running across on each one, waas a frame, then what someone has done. He has selected the part of the body they want to animate on. Then they've moved it in a certain position with the inspector on recorded its movement position on. Then when you play the animation, it will play through all of these key friends and move each individual parts in the manner that you wanted to long story short, we end it with a result like this, which is really cool. But like I said, it's not always that complicated. This is probably being done with a body suit on. Then computer generated. The key frames automatically. Cool. So what else can you do? Well, how about we get the animator to now? Do this wait transition on, then go into another animation and then go back to waiting again. So let's find another quick animation as walk. No. Uh, Bruyn. Let's have a quick look. Well, let's Let's do a jump, okay? I don't I don't know which one. This one is job 18. So I drag you out here. Now, what I need to do is when it loads, it will come through to this animation when it's finished. I wanted to go here. The way you do that is you selects where you want it to go from, right? Click on, make a transition 8. Animating Unity Chan: right click on Make a Transition. Bring it across with this arrow that appears and click on Jump 18 or one B. In fact, now, once that don't what I want to do is go and called back to waiting again. So if I click on the jump animation right click and make a transition back on, then click on weight that will send it through to the jump. And then from the jump back to the weight on at the moment, this will just endlessly cycle. So let's have a quick look. Do what extra thing as well. If I could come game and then click this button here that says, Maximize on play it will take over more of my windows so you can have a clear of you. So let's press play. And that's how we look at these two animations. So here she is waiting away on. Then she's going to jump when she's finished waiting. There we go. A bit of a terrible job, but she did it. She did it on. Now she's back to waiting again. Okay, call. So what have you learned? You've learned how to go to the access store, Find a model on, then load the model into the scene. You've also then learned how to expand the model, find the animation animation clip on, then create an actual animator inside the project panel here, drag that into there so we can control it on then, while the model selected Click on the Animator and you just simply drag the animations out on. That's an introduction to how you can animate a model now. Like I said, not every character has got animations applied. But what you can do is you could import an additional model. Now, in fact, why no? Give me one second. I'll show you quickly save on the Q and A section. Okay, so here we are again. The asset stole. Let's just jump in on. Let's just get another little three D character. Tell you what, Let's go for spacemen. Why no click? I'm free. Why not? Let's let's improvise and be spontaneous. He is a free animated little spaceman. Let's download him on. Install him on. What you be able to see is that you can apply his animations to unity Chan on her animations to his character. Now you can do this with pretty much any character provided they've got the same structure , meaning they're both humanoid. In this particular case, that's going back to the scene on Here's our new Guy. It was open this one up on we have the animations here, Look on. And if I go to the models here is the space man Now he doesn't actually have the textures applied. Got prefab year. We do. A prefab is a template copy model off the spaceman with everything attached to him already . So let's drive him out onto the scene on positioning. Rotate him 1 80 and then we go on. And he already has an animated control. That's or to save time, creating another animator controller. I could just simply click on the space man on. Go to the animator. We can see his animations have bean applied look So he is set to idle and then run Rombach Go left and go right, which are these animations down here? So for press play, he's going to stand idle on. Then he's going to run off somewhere. There we go, Rombach, while this is playing, look, if I sexually animator can actually see the animations happening on the fly. But what I can also do a select the spaceman go into his animator on. Then I can jump through and go into Unity Chance folder into her animations on I Can choose one of her animations, like the jump animation on Drag that out into his controller. I make by right clicking make a transition to the jump. If I just click on this line in between, I can command on backspace to delete the association. There we go on now from Idol. He should go into her jump animation. So provided his three D model character is suitable. It will indeed use the Unity Channel job. So here we go. Let's press play and watch the little space guy. He's idle on there. He's doing the unity Chan jump now. We didn't do a transition back by right clicking or making a transition back, but it's very simple to do that, just like so it's a little stand idle. Do her jump and then he'll go back into idle on a loop over and over again. So it's a very exciting little space man on who wouldn't be so next to Unity champ. Brilliant. Okay, guys, I'll see you in the next video. 9. Creating a canvas and using a button to trigger an animation in Unity: Okay, guys. So welcome. Bike. So how would we go about controlling the animation ourselves, for example, by pressing a button on the screen for a mobile phone, for example? So let's say this were a fighting game on unity Chan was going to attack. Well, she would be stood in her idol polls initially. But then when we pressed a button over here, for example, on the on screen, then we would want her to kick on attack the opponent. Well, I'll show you exactly how to do it. The first thing we need to do is all I've done, by the way, is create recreate the initial scene. Imported unity, China and the Cube on. Now we're at a point where I'm ready to apply the army to control the once again. Now, I still have my my chan any made to control the down here, so I'm just going to drag that across on. Drop it in Now. When I go into the animator here we have the weight animation on. We also have the jump. Now I'm going to get rid of the jump. I don't want her to do that. What I wanted to do is actually do a kick. So let's have a look for her animations. Let's just find one off her kicks. Have a look. Walk, jump, damage damage could be good. Yeah, let's do that. Let's imagine she's actually being kicked rather than kicking herself. I mean, it doesn't really matter which animation which use. I'm just showing you the mechanics. So here we go, our expand, the animation I dragged the clip out onto here on it does indeed need to transition from this animation to the next boats. This time, when I make the transition by right clicking on going across, I'm going to art a little condition. So if I click on the actual transition itself, we have the properties here, and I'll just pull this down for a second. We can see the animation here for press play that she issues waiting on. If I click on damage, then go in will be able to see the damage effects where character actually gets no down. So let's click on this transition on down here. Look, we can see conditions now over here on the left inside. And if you can't see this side panel, by the way, there's a little magic bottom that you just click that what I want you to do is click on Parameters On. Then we're going to set something called a trigger. So if you click the plus and choose Trigger, then I'm going to call my trigger hits. Even call it whatever you want. Just make sure that you remember exactly how you spell it on. If it's lower, case are uppercase capitals just because we're going to refer to this exactly as it's written here in the cold yet that's right. We're going to use cold. Don't worry, though. It's nice and easy. So what I want to do now is instead of going to the end of this transition and then automatically going across if I click here, then I can add a condition on because I've created a trigger here. It will automatically appear in a drop down. I've had multiple. I could choose from different conditions, So what I want is when it comes across to only go across. If this condition is indeed Mets, meaning the trigger has been set by the code. But be careful not to do that now because it will always be true if we press the trigger. So now all I have to do is double click on the weight animation. Make sure the loop time on polls are ticked. So when it gets to the end, it will indeed repeat. And if they're not, then take them, come to the bottom and click Apply. Because now when I press play, all we're going to see is her in the idle state. Now I moved the camera a little bit closer for you guys. You wrong? Wait there we go too far. So way go so that she is. She's happily waiting away. Now. I'll give you a little trick if this is where I want my camera position. If I copy this while I'm in play mode, even though when I come out to the camera will indeed jump back. What I can do is if I click the camera, I can go up here and paste those values in fresh return, and it will now remember exactly where I want my camera. When I press play so right, what are we going to do? Well, let's click on Unity Champ for a second on then on the Inspector. We have these different boxes now these air called components on what you can do is you can add a new one just like we did with BC Sharp Script. Well, this time my top level. I'm going toe out a new script that will just say show damage for example on. Then I'm going to click Create an ad on this will generate a C sharp script with the default code in Unusual on it will be expecting me to write something here because it's attached to this game. Object. Then it will be able to manipulates any of the components that are attached to this game Object. And the one that we want to manipulate is the animator. So let's double click on show damage. This will open up mano develop. Here we go. Okay. Now what I want to do is I want to create in cold an animator. Okay, so I'm going to create an animator called an In There we go now. Animator comes from the model behavior class which is basically the talk it for unity on what I want to do is actually create make this variable, which is nothing at the moment. Just completely No, which means it doesn't have any value. I want the animal here to actually become this object so that we can access a controller. So in the start, if I say Annan is equal to and then I use a function which say's get component here, look, this is an inbuilt function that will get any component. I tell it to the T means type. So let's get the component on. Then what type do I want? Well, I want the animator which will then assign this game object component here to this variable the way the and it, as usual, is with the brackets on a semicolon to end the line. Now anim will become this object. That means I can do whatever I want and we don't leave the update statement this time a public avoid some creating my own function on a making it public, which means that we'll be able to access it from other game objects, fire the public scope function basically. So let's call this the hits. It doesn't really matter what you call it as something to remember Now All I want to do when I press the button is I'm going to call this function on the script and I can do that from a bottom we haven't created yet. By accessing this script on I will be able to trigger any function that is set as public Vyron External game object Don't don't worry, It will make sense in a second Now all I want to do when I press the button call this function and I want to say on him which refers to the animator here on Then I'm going to call an internal called set trigger Now set Trigger expects a string on That's the name off the trigger inside the animator that we created Well, I called mine hits lower case So if I save my script now and close mono develop this arrow will go away as soon as the little circle has updated my script on There we go So this script now contains a function that I've written which grabs a hold of the animator on when the functions called it will jump into the animator associative this game object on it will set this trigger to be true like so now just to make it easier When we go back I'm going to not set any conditions so she will get knocked down, get back up and then come back. Also, I want the animation to be able to interrupt the Idol status as soon as I press it. So let's click here on here, above the settings we have hearts. Exit time now basically means if I I'm playing this animation and it has an exit time, that means it has to finish before it goes through to the next one. So if I uncheck this, that means I can interrupt this animation. Any point could be halfway through as soon as I hit the bottom. The trigger set on this transition will happen immediately, right? So let's create a bottom. Now let's have a look at the world again. This is the three D world. Now we're going to look at some of the two D features. When you look at the game view, this is how it will look on a mobile phone, for example, or anything a PC or or an iPhone or tablet. Whatever. This is what the camera can see now. Ideally, I want a button to appear over the top on. It wants to be flat on the screen on. I don't want the button to be manipulated or distorted in relation to the camera or the three d world. So to do that, imagine that your mobile phone is in front of you like this and you're looking at a screen . And then you were to place a plastic screen protector over the top or a piece of paper that's transparent that will act as a canvas over the top on. That's exactly what we're going to views inside. Unity from the game object. You can apply a converse by going down to you. I on then to converse. Now you would then go to you. I, which means user interface on create a button. But what's cool about unity is if I just create one of thes elements, like a text box or a button. Then it knows that I need a compass as well, so automatically create anyone in this in the hierarchy. Now, to demonstrate an alternate way of doing this, I can also right click in the hierarchy on get the same menu. So let's do that. Let's go down to the U. R E and create a bottle on. Here we go. We've now got a button. If I go back to the scene for a second and I switched to two D here, everything becomes flat, and if I double click on the Converse, we can see our canvas, which acts almost like a screen protector over the actual scene. Now, don't worry. It's always huge in relation to the actual world. The most important thing to remember about canvas is that we wanted to cover the entire mobile form, screen size or tabler. So therefore, we need to know how big the screen is. We're not going to new that. No, that it's an impossible variable. But what you could do with a canvas while it's selected is down here. We have got something called a canvas scaler, and if we click here instead of keeping a constant size, I wanted to scale with screen size. Now I ask you for a reference resolution. Now, if I quickly switched to my game view here were set to free aspect. But if I click the menu, then we have different screen resolutions Now, very mind. I've been using unity for a while, so I'm a few extras down here. What I did was I went to Google and attacked in the screen size of an iPhone six and a four on it gave me the pixel size. Now, if you want these options, you click the little button here, type in the name, give it a fixed width and height and click OK and you'll create your own custom list. Now what I'm going to do is I'm going to select an iPhone six in landscape mode, which is 1334 by 7 50 Not just cancel this for a second and then select or watch the screen jump slightly that we go. Now you may be thinking that the button is actually not on the screen, and that's because I'm slightly zoomed in here. Look, I can zoom in and out. Come right out, then pull it right out on. Then what I need to do is click the button over here. The inspector now the button selected. We have the normal coordinates on. I have something called a wreck transform, which gives me this target to represent the converse. If you click it, it says if you hold shift, it will set the pivot, which is currently set to the centre of the button. If I hold bolt, it will also select the position. So I'm going to hold shift and bolt on. Click the bottom left and wash the butter jump. There we go Now it's perfectly positioned in the bottom left. If I want the middle, I could do that. Top the bottom or the right, which is in fact, what I want in this case. Now bear in mind. The reason it was slightly off is because I hadn't told my compass how big I wanted the resolution. So if I make it 1334 by 7 50 which is in fact the height off on iPhone, then the button has shrunk to correlate to its original size, which was smaller than this. Remember, it was 800 across. So that means that the bottom could have only bean about 100. Or maybe about 1 50 If I increase the with the bottom will remain the same. Sorry. So now I need to scale my bottom up slightly. So I'm going to make it about 2 20 by a bowel 100. There we go. That be nice. And easy for us to hit. If I click the move to go back to the scene, come out slightly while the buttons liked it so I could just move that around. And it's still fixed into the corner now because for double click on the canvas, you can see the compass size and become a scale. It is set to be thief. Fixed dimensions of the width and height in relation means if I go to the game old and I were to shrink this, then watch the bottom move on, shrink in size so it keeps it's size on with on position relative to the screen size. And there we go. We've solved a massive problem. Lots of people have where buttons disappear off the screen when you switch from portrait toe landscape and you using different size devices. So we got a mess, my layout of a little bit, but there we go anyway. So that's a quick introduction to the converse. So if I right click, can also atom you, I text, which is really small. But here, if I want the tech selected click here shift and also on positioning up at the top, then it will move the text to the top up here. Now if I just go to the scene so I can see my text, I want to bring this down. A moving across this button here will increase the scale off user interface elements so I could just make that bigger, like so on. Then the text here will be saying Unity Chan demo, for example on then I can mess around with the text. Now notice. I can drag the funk size. I can come down further and center it vertically as well. And I can change the color like so I could also make it bold if I want On another court trick is there's a magic button that says Best fit that will automatically address the font size to fit inside this size box, regardless of what size the screen actually is. So not have messed around with it a little bit. I'm actually going to click on the top center again and just moving back there we go grab the move toe, don't bring it down, and now look at the game view a little bit too low. Let's go a little bit higher. We go so This is a unity chance off but Demi into the demo accidentally. Bit of a type of that guys on. Now. If I press play, the tags on the bottom will remain over the top, regardless of the animation look so I can even click on the camera, move the camera on the text stays over the top, say, just as if we had a screen protector over the top on, we draw on the button on our we drawn or written the text on. I can even click the button on it changes. Look, there we go. So now what do we need to do? Well, if you remember in the Animator, which set a condition that if hit was called, it would then transition through to the damage. So let's go to the scene. Select the bottom, making sure you're not on the nested text inside that say's button. Make sure on the button and come across to the inspector. Now, one of the components of a button is this magic area here that says on click, What do you want me to do? Well, if we click the plus symbol, it say's that it wants an object to refer to when you click well, the object that we want to manipulate is the animator, which is attached to unity charm. So if I click on Unity Chan for a second, she has the script. Well, that's what we want. So let's go to the bottom scroll down and let's drag unity challenge as she is the one with the script on that we want to access. Now I have a drop down. I can click it on. I can access my shell damage script, and that means now because I made the public function for show hit off the heads. I can now see that in my list because it was a public function inside the script, so that means other objects can access it. If it were private than Onley, Unity Channel script functions will be able to access that. So long story short, I compress play now on. She will remain in idle now if I just grab the animator and pull this down here so we can see the two together 10. Creating a canvas and using a button to trigger an animation in Unity - Part 2: you can see. Look, she's waiting and waiting, awaiting the waiting. And when it gets to the end, it goes back through. Now what I'm going to do, I'm going to click the button, which has this on click event which will access the unity charm game object. Go through my script. I'm just created Onda. We've told it to choose the public function that I created on If you remember, the public function I created said Grab the Animator. And then when I hit the bottom, then I want you to set that trigger to be hit, which will make this condition true. Andi, she should receive damage. So let's see. Pau. There she goes. It works fantastic. I'm back to idle. Brilliant. In fact, guys, let's see that one more time back into play mode. And here she is. She stood around idly waiting on If we could con the transition, remember, I ticks. What I inject the has exit time, which means as soon as I hit this button I can interrupt this animation. So to demonstrate that are waiting, that comes around here and I just throw a hit already off that she goes. I hope she gets again, Fantasticks like buff. Knock it down again. She's a tough girl. I hope she gets back again. Okay, guys, wake up. It's time for a mini challenge. What I want you guys to do is create an additional button. Then when you to go to the Unity Chance script, I want you to open up, show damage and create a second function. Now, once you've created the second function, what you're going to have to do is go into the animator on. I want you to go to the project and draggin and new for put my enemy to back up again. I want you to drug in a new animation on, then transition from the weight to the new transition to the new animation I'm back. So basically, repeat what we've just done on your own. I want you to create a new trigger on place a new button on the scene here so that when you press that button it calls, your new function triggers the new trigger on transitions to the new animation. Okay, guys oppose the video. Do what you can and come back on. When you press play, I'll show you how I do it. Okay, guys, here we go. So there's loads of different ways of doing this thistles away. I'm going to do it. I'm going to right click on duplicate this button on, then going to pin it into the opposite corner, holding shift and old, and it moves it across and then going to drag my butter. Now I move it up slightly now because I made a duplicate of this bottom. It already has the same function attached and then going to jump back into mono develop, and I'm going to copy and paste my function. And I'm just going to call it the hit to on our created new triggering a second called Fred . Why not? And I'll save my script if I jump back to my animator, creating them trigger, making sure it's named exactly the same as what I've just written in the cold. Fred. All I need to do is find an animation I want inside Unity Chance animations, for example, Jump 18 or one B. We've what we've already used that will try a different one. Let's try slide. Okay, No worries. Let's expand drug out the animation on, then right click from here to here. Right? Click from here to here. But click on this initial transition on check has as they exit time and create a new condition. But this time it will be Fred my, for just preview the animation. Here we go. She is waiting, waiting, waiting. When it gets to the end, she will then slide. We don't. There we go. Call. Okay. So that's what we want to see. If I come back to my books and on the scene, all I want to do is make sure when I click the button this time I call the other function hit too. Press play on. It should work. Here we go. I compress power on Hits it down. Or I could make a slide. There we go. Fantastic. So if you've got anything close to that fantastic, well done on, get ready. Because I'm about to give you a mini coy's on everything we've done so far. Okay, I'll see you in the next video. 11. A very quick and simple look at 2D game physics before moving into 3D worlds: Okay, guys, welcome back. So it's time to have a quick look at two D games. I'm not going to go crazy on this one because there are a 1,000,000 literally about a 1,000,000 videos on this on YouTube. I wanted to make this course as more of an introduction to three D elements, which there are far fewer over in comparison Now. That said, let's let's get going. What I'm going to do is just create a simple two D seen basically. So that's what I call my project. On this time I'm going to click to D. Okay, and then I'm going to just simply create the project. So this time, what it basically does is it will set up the scene knowing that I want to create a two D environment rather than a three d environment, so it will automatically be toggled that way. Here we go. Look now, still want my game toe look like an iPhone six? If I got to my game, I want to make sure I have on six. Landscape is selected on his my scene. Now all I have I mean, it looks just the same as if as a three d one look, but they've totaled it so that we have this two D environment. So it looks more like what you'd expect a to d game toe look like. Now the first thing I want to do is go to the assets and import the two D package on. This includes a bunch off assets that we can have a little bit of a play with. Let's just wait for that to import for a second, so we're going to create kind of like a platform in a ball on. We're going to make it simulate the effect of it moving around on falling down, basically. So let's have a quick look what are in the pre fabs folders? So we've got a character. We've also got great. We've got a couple of different platforms here. Let's drag a platform out onto our to the environment. Now. If I press play, always see. Is this platform now as the game. Now, if I drank the character out on pop in above, then you can see he falls down. Now the reason he's falling down If I just moving highest, he can see that again. A press play he falls down. Look, now that's all down to the physics. If I switch this to a three d view for a second, you can see that it's actually still using a three D world. Now, if I just switched back to the two D view for a second on, let's just say that I I want to create my own two D objects is a sprite, which is basically a graphic on. I'm just going to use this background texture as my actual sprite. Now watch what happens here. I press play on mine behaves more like a background image really doesn't fall down. It doesn't interact with the physics, and it definitely doesn't sit on top of this platform on. That's because there's a slight difference in A to enable the physics engine. You need to add a component called a rigid body on because this is a region body for a two D game, then that's the one that we need to use that will enable the physics engine, which will include things like a must for the actual object that we're that we're using. So when I press play now, it drops down the screen. Now, why did it drop down the screen and not stop on the on the platform? Where is a character actually did that? Let's watch again. They both drop because they both got a rigid body. Now I can make him drop slower by reducing. His marks are increasing his his drag. Really, which is kind of like wind resistance. But the rial differences, in fact, like I'm a platform on, I expand it. It has something called a collider. Mr. Assuming for a second on, if I just disable the where is it? The sprite? Here, spot renderers. Look here. This is called a box collider and it's basically like a force field around the element itself. I'm just enable that sprite bike on Now when two objects have colliders attached on one of them has a region body, then it will act as a collision detection aims in the physics system. So with that logic, if I add a collider to my sprite as it falls, it should stop when it hits the other collider. Now, why is it the platform moving then? If the other two, if wealthy other model a moment has a collider and this one has a collider on the character here has a rigid body. Then why? Why is it this one being affected by gravity? Well, that's because this platform here, if you look through the different elements, are involved. It doesn't have a rigid body attached. Therefore, it's no affected by the gravity. Just has a collider, And that's how people do things like three boundaries off a game where the ball would bounce around the screen. They would add a box, for example, are a cube on, position it to the edges off the screen and give it a collider on. Then they would add a sphere or a bald aunt. Give that a collider on. It's allowed to move around inside the two D environment, but the collisions will stop one off them from going through the other element. So let's add a collider to this, because it's square the most. The one that makes the most sense is a box collider. So let's add a box collider to D. There we go. So now we have a collider attached to my a square cube sprite that I loaded in for press play. Now it does indeed sit on the platform on. That's how the collision has been detected. Now, what about if I want this to be used as a platform, so I don't want it to be affected by gravity? Well, if you look down at the rigid body, I can freeze the position off the X y and said, if I like and then when I press play, it doesn't go anyway. So therefore I can use mine as a platform on because it has a collider aunt. He has a collider. Although he also has a region body on is affected by the physics system. We click on him. That would go look, but he isn't told to freeze his position on the X on. Why? Just there's dead so we can't get back into into this. This direction over here, this is is that look the blue axis. We don't want him to go further away. So now he should sit on top of my box. Then we go. Look, now if I just maximize and play on, come out for a second. If I want to grab my sprites a moving while we're in the scene, I just grab the position of the eggs. I can move this on. He's still affected by gravity and he will drop that. We go look and that's because he the edge off the collider. Likewise, if I move the object into him, it will effectively push him off the platform and assumes his feet off the edge of this box collider. He will indeed ball to his death off. There he goes. Fantastic. So in the same way that we moved the cube on rotated the Cuban the C sharp temper. Then by that kind of logic, in theory, I could move my sprites from left to right. So all I need to know is basically the exposition. If I start my cube here on, it's at minus 6.1, for example, I can just simply attach a script on on the update statement. Just slowly increase the position of the eggs so it moves across. And then when it gets to 3.6 or 3.4, then I can change it. I make it minus off the exposition, and that will automatically make a movement platform. So that's how simple game logistics interact with the physics engine. All you have to do is import your Jeep a cop. PNG images Make sure that when you imported on objects, the system knows what it is. For example, if I randomly import graphic, which is this PNG here? Because we say unity up as the two D environment rather than the three D environment. Then here's my image here and in the inspector. While the images selected it doesn't treat it as a texture as it would do inside the three d world actually knows that it's a sprite. The sprite is just another word for an image really to be used in this two d environment. So if I want to use this, for example, why don't we just bring this out to on? If I leave it as it is, it will just be like a background image in the game. Appear so that could be a cloud, for example. Or it could be an image off a scene in the background, and there it is. But let's say I want to make this a platform as well. Then let's bring it across at a box collider, do a two D box collider. Sorry we go. And now, because it has a box collider it's automatically become a platform to stand on now. The problem is, the letters are here on the box. Collider goes around the entire logo. On the top of the logo look has this kind of brain symbol here. Now that's not really going to work for me, because what I want is I want a character to look like. He sat on the collider, So what I can do while this object is selected is I can edit the collider on. I can write this down and shrink it here. I can then, if I want to at an additional collider for this top section. So let's try again on watch if he sits neatly on the logo. Now that we go, look, I it works the same with other objects as well. Let's bring this over here on. Let's rotate this object so it's at an angle. Well, no, that way, though. There we go. Now. What I want to demonstrate is I cannot an additional game object, which I could make a three the object if I want to make a sphere. Here we go. I just use my move. Tool on here is a ball. It's actually a three D objects. Look, but I'm using the two d engine now. If I apply well, if I press play now, nothing. What happened? It would just sit there like a son. But if I apply a rigid body to this object, then okay. Many era yet this is basically saying I can't add it because it has a sphere collided. So I'm just going to remove the collider off. I have off the three D objects. There we go. Now. If I had a rigid body, Andi, I add a circle collide and rather than the default three D collider Now I can still use the physics engine because it has a rigid body which will give you a mass on. That means that it's affected by gravity. However, when it hits this platform, it should move down the platform. When I press play there we go look and he holds also hospital a rigid body. So when the ball hit the character, he it bounced off him automatically because the two colliders have collided. Okay, So, like I said, this is literally just is more like a bonus video thrown into the course just to touch on two D and how the physics engine automatically users on converts the objects as soon as they have a rigid body dropped into the system, and you can adjust the gravity and the mass, and you can make platforms and characters interact with each other. So, for example, you could easily make a game where you have at the side. You have three platforms on. Do you have a ball on? Do you have to position the platforms to drop it into the bowl? So it runs into this area here. That could be the goal. So if I grab this platform and duplicated it, brought this down here on, rotated it slightly, there we go. Touched this one on, rotated you slightly. Then my three platforms at the side that could drag them into the game, press a button to play on the ball would roll down. He's gonna hit the character, though some of the characters to the side for a second. There we go. He can land on the box on the ball. War and down on the physics engine is smart enough. Look to achieve the effect that we want now because there isn't a platform underneath. Then when that ball drops, if it were to fit, which it doesn't in this case, then it would just endlessly drop. Now one last thing if we jump back to the assets store for a second. If you type in two de platform or two D product, for example, in here there are hundreds on hundreds of two D Templars. Some of them are complete games now to experiment and learn more in your own pace, I'd recommend downloading a few of thes games, opening them up and having a look how the physics work and how the actual graphics have Bean put together into the scene to create things like side scrolling backgrounds and things like that. Because all that is is what we've already covered. Somebody has added a graphic to the bark, and then they've attached a component with the script and called on action to make the image move on the X axis. So it's just a little bit of a learning curve that you guys want to experiment with just a bonus video from my side, because I wanted to concentrate more on the three D concepts anyway, let's move on on. Let's look out to reigns 12. Creating a 3D world in Unity - Terrain with a FPS controller: Okay, guys, I hope you're ready for some fun because this is going to be awesome. We're going to create ah full three d environment that we will be able to walk around and explore ourselves using the first person controller camera. Now, the first thing I need you to do is go up to the assets and I want you to import a package on. I want you to import the character package. Hi, guys. I just wanted to drop a mini insert into this video because unity is constantly evolving on as some of you may be finding now on the latest versions of Unity 2018.3, something on Unity 2019. What they've actually decided to do is take out the standard assets park, which will make the overall installation of unity a little bit lighter. Now don't worry, though, because you can still go to the Unity website and go to the download archive on download or the standard assets there in exactly the same way that you can get copies of the shade er's and things like that. Now they've also left a copy off the standard assets inside the Assets Store, which is my kind of go to way of doing this. So what? I would suggest you in distinctly opening up of the assets start tab on having a search for standard assets on you'll be able to download everything on Continue with the course that way. Okay, Cool about speak, teasing dice because this includes a first person controller with sound effects for footsteps on it automatically has to script attach so that we can use the cue the W A S D keys to move around. So that's import at on. That will create a bunch of folders down the bottom. Here it's giving a second. The next thing that we're going to do is we're going to import the environmental package so exactly the same place we go toe assets and then we're going to go toe import package and we're going to choose the mental talk. It basically it's it's fantastic. You're really going to like this guys. So one second while this just finishes up, here we go. We've got the standard access on, and that includes a first person control. It also includes 1/3 person control. If you want to play around with that later on. Now let's go back up to the assets, import another one, and we're going to import the environment. So this package includes textures, models for things like trees and grass on a stone surface on all that kind of think. So here we go. It's important to this is just basically setting up our talk it so that we can actually have have some fun. Really? Here we go. Nearly done. Yep. Import everything all good. Here we go. Look that that there. The trees. Conifer tree coming in. Let's use that. Why? No, we've got palm tree as well. We've got loads and loads of different things. It also includes something called normal maps on image maps. So basically, it will add textures to the actual landscapers were walking on it, given it kind of a bumpy feel, So it's really, really fantastically put together. Okay? Yeah, some Some don't need to be there. That's fine. OK, so now we've got a bunch off environmental talk. It's a swell and we've got trees low. We've got Conifer trees. Here's a Conifer tree. Strike you out for a second. There we go. Is there is a massive Conifer tree. Cool, right? We don't need you yet. Let's just get rid of that for a second, right? Okay, So what are we going to do first? Well, what we're going to walk around on is something called Terrain. So if you run it, click and go to three D objects, I want you to go down to terrain now by default. It's pretty huge. As you can see. Now we go. It's a huge world. In fact, it's a little bit too big for this demo purpose. So while the terrain selected, if you look across it the inspector, we have a bunch of different options. One of them has a cog on it for settings. If you just click on that for a second and scroll down, it's got the terrain, width and height. And I just want you to make a little bit smaller, making 300 by 300 as we don't need it to be absolutely massive. Okay, so what do we do next? Well, if we still like the terrain, what I'm going to show you is how you can raise on lower the terrain to create a hillside on a mountainous area. So it's called Back up to the top of here. We've got these different options by rolling the mouse over. It will actually tell you what each but it does now. The first thing that I want to do is select this one on. This is to raise, unload the terrain height. Basically, all I have to do is click and drag on that will raise the land. If I hold down, shift and drag, then I will lower the land. These are the different brushes, which will dictate the terrain roughness. So at the moment when he was in a very smooth brush, Theburbs Tsai's is quite big. I'm just going to bring that down, and I'll just give you a quick example. If I click and drag, we can see a mountainous hillside appearing Now. If I make the brush size larger, then as you can expect the hills bigger. One thing I'm going to do quickly for a second. It switched to the directional light, and I'm just going toe drag down the intensity a tiny bit so that we can see a little bit more definition off the hillside and we go look. So if I click the terrain again, Andi, to demonstrate the different brushes. If we just like this one, which is a little bit rougher on a zoom down to the terrain. If I click and drag now, I'll bring the brush size down a bit, too. And look, you can see we get kind of a spiky mountain range. Here. Look, you gotta be careful not to click and hold too long. Otherwise you're gonna get something huge flying up into into the top of the scene. Basically, I feel just come over here for a second. Add some some hillside to this side as well. Let's increase the birth size. Just direct this around. Here we go looking good, looking good. It doesn't look too much like landscape at the moment because it doesn't have any texture applied to it. But just bear with me, guys. That's all about to change very shortly. Let's just make something appear like a larger. I want to create some kind of background to first have a look at and we go. I want to go too crazy with it because I actually want to be able to walk around this thing . Let's just don't around a few bumpy areas here at the base of the hill side. Bring bring the brush size down of end. Just give it a little bit of a Here we go. So this is all just trial. And Harry, yours will look completely different to mine. If you make him a steak with me, you can just hold shift and click on that will lower the hillside. Now, if it's a little bit too spikey like this, for example, the next bottom along will actually accept the terrain height and then the 3rd 1 will smooth the terrain height so I can actually click and smooth this out you see on it will actually reduce the spiky nous off the hillside. Now, this is particularly good. Don't have too many big spiky edges on. That's because all these spiky edges I'm a co polygons on the higher the polygon count, meaning the amount of triangle is going to use up more and more processing power off the mobile phone. So I'm just going to just block this off a little bit around this side for just like that. We go cool so it doesn't really matter cause we're going to go all the way around this thing. I just want to show you how we can actually create the willed. It will be quite huge. Trust me. Now, how do we make it look like Lund? Well, if we come across the paint brush, this is how you can add textures. And if I just click Eddie textures and then add a texture, then I get this little papa box here. Now if I click select, I can choose a texture to use as the base textures on by scrolling through the list. One of them here look, is called Grass Hill albedo, and that's exactly what this thing wants. Now, if you want to add a normal map, which is a texture feel, you can choose one of thes kind of purple looking ones and that will give it a texture. But for now, I'm happy as it is now before I click. OK, if I just get rid of this, watch what happens when I add the first base texture to outer rain. All of a sudden, look, it starts to look like real Lund. If you came right down, then it definitely starts looking like a real world. Now let's are a second texture and make these spiky kind of mountainous areas look more like mountains. So for click edit textures and add a new one, I'm going to add the's the rock face here at that one on. By using the paint brush, I can select a brush on increase the A passage facility, then overrides the base texture on. I can kind of paint mountainous edges onto this onto the surface. Just increase it even more. No, for choose that one. It will work a little bit better that we go. So I look, see? Now we're getting kind of a stony rock feel to the actual hillside on that that couldn't work exactly the same. It maybe you want to add some snow to the top of this, then all we need is kind of a brush, maybe a little bit too much. This Let's bring that down a bit. There we go. Look, and I could add some grass back on the hill. I was simply painting it on, and you can have some real fun with this and go into it in as much detail as you want. You can also have your own textures on. Like I said, if you wanted to make snow capped or you'd have to do is add a texture, which you could create a photo shop, for example on. Then you could right click and import the new asset. And then you could select your new texture. Andi. It would load here. On that way, you would have access to do exactly the same so you could create a a canvas in photo shop that's 5 12 by 5 12 with kind of a ice snow. Look to it, and then we could use that as a texture to kind of paint. On top of this terrain, I'm give it kind of a snowcapped feel to it now. One thing that's missing is a little bit of grass and a few trees, So let's click the terrain again. I move across to the next button, which is for trees on. Like I said, because we imported the environmental assets. We've got things like Conifers, palm trees and other things. Now all it needs is for me to select a tree, because at the moment I don't have any trees defined. So if I click any trees and add a tree looking for a game object. So let's find a tree. Let's choose the comic for here. Double click on at now. We have a tree loaded it. Let's just add one more. Here we go. Get some palm trees. Why? No, probably not gonna look very good next to each other, but it's just as an example now look at the brush size look at the tree intensity. Also, look at the tree height. I'm gonna bring that right down because I don't want to. Trees to be absolutely 100 meters in the sky won't look realistic boats. If I click, I can place trees. Look, if I zoom down, can actually see too far. I can actually see the trees that I've created. It might be a little bit small. Let's make them bigger. Let's move over over here and creates and palm trees. There we go. So they're a bit bigger and now it's awesome. Conifers just having to think for a second. There were out there a little bit too big. Shrink them down a bit. We go. So I'm just going to paint a bunch of true Whoa! While we've got a jungle now. Okay, so we've got a cool, different variety of things now. Now, if I bring my brush size down, then it will actually give me more control over the amount of trees that I place. There we go now. One last thing before we decide toe actually have a play in this area is how it's got a little bit of grass. So let's come across to this lacks button and then it wants some grass. So let's add a grass texture on the one that I want. Is this one here? So let's choose this grass frond Owen albedo out for Let's Click on that one and at it. And then if I increase the birth size, I can kind of paint some grass areas onto the texture and we go look on. It doesn't look fantastic. I'm just giving you guys a bit of a demonstration about the different things that you can do. I just don't this about a little bit make it a little bit small on the brush, and we kind of have bushes instead. And if I lower the a pass ity, then that will make the grass a little bit more sparse. Okay, so now we've within minutes created a terrain with trees and grass on a rocky surface on a bunch of other things. How about we have a walk around this place? Let's come up to the top level of the assets. Apologies. If you can hear the fun of the laptop, I'm just going to move that away slightly. What I want to do is go into the characters folder into the first person controller into pre fabs on. Then we have this thing here, which is the first person controller. So this is kind of like your call of duty camera set up where you're actually looking through the camera from the characters eyes. Now, what I want to do is I'm going to drag my first person controller out onto the scene. There we go. Now it's appeared here on it already has a camera attached to it. So that means I don't need this one. I can get rid of that initial camera. How we go on going to tack this as the main camera. If I double click on the FPs controller, it was zoom right down and you can see well already this is going to look pretty cool. You can see the first person controller, however they use a captial on. You need to move that up a little bit now. It's also a little bit small, so let's increase the size a little bit, like just in the scale. I'm just pulling this up, and that's how you can adjust the height off the character. Okay, now, if we come around, you can see where the actual cameras facing on. If we look at the game view now, this is what the camera will actually see when the game begins. Now, remember when we imported the standard assets on the character pack? It came with the first person. Control the script on Dhere. Look in the inspector. You can decide on the speed that you walk and run around on a bunch of other different things. You can also use a space bar to jump. Okay, so check this out. Let's go to maximize on play, I'm click play. This is going to use tell a volume down a little bit. Dixon hooked up to a bigger sound system, but now I can use my mouse to look around the world that we've just created. How cool is that? I can also use W a s D on the keyboard toe actually walk around on space to jump on I can go and explore and look at all these call trees that we've just created We can walk up the hills we could jump on We can go and explore wherever we wanted If I just press escape that will give me my arrow back and I can come out of play mode Now let's just make a slight adjustment. I'm going to make the start position off my first person controller to be somewhere over here, still a click and zoom back into him. Make sure that we're above land When we start there. We go on this time also going to rotate the camera. So let's rotates on the, uh on the access here. I'm press play again, and now it starts me in a completely different area. I can still walk up the hills and less atom state, but as with other games, you press space and he can jump up. And it's that simple guys. It's that simple. You can just build a terrain in minutes using unities pre built assets. Now, if you went to the asset store, you could also download additional trees. You can also download additional textures. You can even download something called the Sky Box, which will change the color on the feel of the sky. I for come out of this for a second. One of the other things that I want to show you guys. If I bring my first person controller back over towards the trees like that, we go about right, we're going to be looking at trees. I want to add something called a wind zone. Now only works with certain trees. This boats. Let's add a wind zone onto the actual scene, right Click three D object Wind zone. 13. Adding a wind zone & making it snow on a Unity terrain: Okay, let's double click the wind zone. It's put it over here, which I don't really want. Let's bring it up. A moving across there we go soon. Double click and we go. So now where there's our first person control, that look on what this is doing Similar to the light. This is currently a directional wind, which doesn't really matter where it is on the scene. It will blow in this direction there where the arrow's pointing. So if I press play now and we should see a little bit of action on the trees, then we go. Look, how cool is that? That's a little bit intense, but look, even the grass is being affected by the wind. Fantastic. Now how about we change the type off wind zone that it is? You can change it from being a directional to a spherical. That means that only the trees inside the sphere will be affected by the wind zone. And I can adjust the radius on the turbulence, which is a strength of the wind. I can even adjust the pulse on the pulse frequency of how often the wind blows. If I just move this over here. So it's in the camera's view. I'm press play now. Only the trees within the wind zone will be affected, whereas other trees over that won't really be affected by the winds. Oh, look, See? They're not moving. These guys are moving. And that's how you can create a kind of effect where you could walk on a hillside and suddenly the wind is blowing How you could walk inside a house uncertainly all the wind stops Now if I'm unhappy, press escape come out. I'm unhappy about the speed that I'm walking around. I can change the speed to 15 on the run speed to about 30 a press play again. And now look at the speed. I'm running around much faster, although the sound effect needs a little bit of an adjustment. In fact, I normally turn the footsteps sound off, which is down here. I can you just basically take this on and change it to non Andi, you wouldn't have the footsteps. You can also adjust the one step length and things like that. So if I increase that, then I won't run around and make us much noise. Uh, it's frequently way really. That much difference in this particular techniques, but that you go, guys. That is how you can simply very quickly create a three D world imports trees, grass mess with the terrain. Andi, apply wind zones on a first person controller till run around inside your world. Okay, guy. So this is where we last left off. Now what I'm going to do next is show you how you can kind of add a few cool effects to our environment. Now for school down a second. What I want to do is create on effect that it's either snowing or raining, depending where we are now. To do that, I'm going to use something called particle systems. So come up to the assets and import package called particle systems. Now, this will import a bunch of things once more. But it will also include a bunch of prefabricated particle systems, things like smoke effects on different different dust clouds and things like that. Now it adds that to the standard assets that we've already got imported on. Now, look, we have an additional folder for particle systems now, inside particle systems, there's a pre fabs folder on inside that we have got something called a dust storm on a dust storm for mobile. Now, this particular version isn't for mobile, so I'm just going to drag out the dust storm on placing over here like so on. You can see. Look, it actually generates an effect off a dust cloud. Now, if I press play now, I walk around this little environment, you can see the particle effects and certainly we've got some environmental features. Teoh. Cool little scene. Now, if I come out of this for a second, let's press escape where we go, I'm just going to change the speed that I'm walking around as a kind of frustrating me about the double sound effect. How you can edit a particle effects if you click on the dust storm. Here, look, we have in the inspector a bunch of objects. Andi parameters. Now you can play with this to your heart's content. One of the easiest things I want to show you is how you can change the start on the ankle. So let's say that I wanted this to look more like like smoke off fog going through the trees. Then I can simply change the start color on the n color to be a whiter color. And now look, it will give the effect that it's kind of a misty morning. I want actually walking through fog. I can also move this particle system so that it appears only on top of like a mountain range, for example, on that will give the effect that clouds are actually moving for through the the Mountain range. Like so. So let's have another quick look for just look left. Look, how fantastic does this look? It's something so simple on give such a cool impact. Now imagine that we'd already painted the tips of thes white. Then this would indeed look like a cloud is passing through on. I can adjust the size of this particle system the same way that I can adjust anything else . I can even adjust the shape on, Change it from being a box, like so to look more like a hemisphere like, So it really does suit your needs for depend depending on what you want to do. Maybe you wanted to make it look like a red color on that would give the impression of, for example, fire going through the actual If I bring this back down to Earth for a second, it could look like fire going through the trees and actually kind of creating a burn smoky effect like so. Or you could use a smaller version and use it as something like a flare inside actual environment, where you could then create a plane that appears over the top on. That's just one of the pre fabricators ones. I'll just delete that for a second. Here we go. No, there are. There are loads and loads and loads. One of my favorite ones is for the explosions. Where is the first person control that that we are? I need to make sure that I'm looking in the right direction when I use this. You see, I distract the explosion out on place in front here and raise it slightly. When I press play, we should see an explosion bank that we go Fantastic. So this is a cool little prefab that we can spawn later on in the game, for example, when something explodes. So if I just bring that a little bit closer to the character for a second, we should be able to see a little bit better. Here we go. Play again. Bang on that. Fantastic. You can also use it for things like fireworks or whatever you want. Now what I want to do now is surely how you can create your very own custom particle system . We're going to use this as an effect of snow or rain. All I want you to do is right. Click Come down, Teoh effects on go to particle system. There we go on. That will create the default particle system. It's not looking how we want it to at the minute on its way to High Sky. Let's bring in at least interview by shrinking down Well, not shrinking down. Bring it down! Sorry. Now we dio. I was trying to get it in front of the camera. So how close are we now? Pretty close. There we go on. Let me just test it by switching to the game view. Yet we can definitely see that particle system so it's in the right area for what I want to do now if I bring it up in the sky above the character and then I make this particle system a child off the first person controller. That means that when I move around, the particle system will always remain nested above us. So let's switch this around. So it's facing downwards rather than upwards, by just pulling on this rotation access like. So now if I just press play for a second on, I look up, there's a particle system on. If I move around, it actually follows us around, and that's a cool little effect to create. As if I mean, it doesn't look like snow at the minute granted. But you can see how the nesting off the particle system remains above the character to create this kind of snowy effect on that's so much easier on the power of the machine and the memory, rather than creating a particle system, is actually enormous to cover and engulf the entire terrain. Just a small little hack that works so effectively. Now let's let's have a play with this. Let's slow this down slightly. So let's look at the start speed and change that to be a war or even two. There we go. Let's also increase the duration to be about 10 so that it actually falls further. I'm also going to change the shape to be more like a hemisphere. There we go. Arms. Let's have a look. The gravity modifier. Let's increase the amount of gravity to North 0.3 and now let me see forced to the floor. So let's try no point No. Five. Still too fast. They've got no point to. Okay, let's scroll on. Increase the amount of particles on the emission. So let's make this throughout 100 time. Andi. Let's make the max particles about 300. Let's also make the speed now the start size of it bigger, a little bit smaller. Even here we go on, this is basically just a case of trial and error. You can mess around with the start position of the end position. Now we can change the velocity overtime. The force, the color over time signs over the lifetime on this is currently the default particle. Now, if I just make it so I'm happy with the he size for a second. What type? Let's have a look for a spear on. Let's increase the size like so and then listen. Let's decrease the size of the particles and slow them down, so size is bringing you down to be a lot smaller that we go. It's just increased aside the time a little bit more. I'm bring it down slower where we go still going too fast. But you can see the idea of what I'm doing. I'm adjusting the size, the speed Onda and the rate of a mission for the particle system on that effects the viewable area. I mean, all I have to do really is just making a lot bigger. We go. And then if I decrease the amount that come out to about 20 I'm pressed. Play. We need to mess around the gravity a little bit, but here we go look. So if the particles were a little bit smaller and I slowed it down just a tad more and it would at least look like it's snowing slightly now, let's see. Finally do that. Let's just think decrease the, uh, speed on the start size. There we go. Let's have another look Now. In fact, if I making smaller, actually need to bring it down into the viewable area or a little bit more like so if I increase, the gravity will actually fall to the ground a little bit quicker as well, but that we go Look now, if you combine the two, you could use a dust storm cloud. Andi, create this. This does start to look a little bit more like snow now, but you could you could use a dust cloud. Andi, you could slow it down slightly and change the color to be white. And it would give the impression that you're kind of in a snow storm on then these individual particles flying around, which don't really suit a tropical palm tree and fireman. But you can see the point that I'm kind of making is a solid foundation for you to experiment on on play around with Just don't go too crazy with the amount of particles are actually generated as once again, it effects the performance. So if he starts toe lag a little bit and you know to either remove some trees or to decrease the amount of particles. But what a cool little hack. Let's place a particle system above the camera, increasing gravity slightly. Andi just mess around a little bit with the settings until we get the kind of effect like this, um, to make it snow. Now if you wanted it to rain then or you'd have to do is come down to the default particle here. And you could change this for a different particle material to basically re skin through the particle itself on. Then what I probably do is increase the gravity slightly to speed it up. I make it fall faster. That would look more like rain. So if we changed, I mean, just temporarily. I'm just changed the collect to be, um, like a blue color. There we go. I'm going to increase the size a little bit just so that we can see it. Not that much to still too big. There we go. So I've increased the gravity slightly to speed up the effect on I changed the particle call to be blue. Now, if increasing gravity more than it will fall faster and and get rid of the kind of floaty effect if you were to switch the texture from the default particle to something that looked more like a raindrop, which is a good trick, by the way, is if you simply create creator a line a square in photo shop with the line a white line drawn on it on that will give kind of lines of rain coming down the screen. So that's what you'd have to do it or you'd have to do is swap the texture out. Andi can play around with particle system. Now let's combine the two for a second. Let's throw a dust storm in. Let's change the color of the distance. Be white like so I'm also going to increase the size on the size of the particles. There we go, And then let's see how this looks now. If I hadn't painted the ground with the grass texture, it was a snowy texture. Then I'd use models that were snowy trees rather than the default trees by grabbing hold of a different one from the asset store. Then this has got potential. This has got potential to start creating an environment. Now let's imagine you were playing a game and you wanted to walk into rain. Our walk through some rain, and then the rain stopped. Then all you'd have to do is not have the particle system nested as a child of the camera. So if I take this out for a second like so and I just move it over. I don't know. Over here. Then what will happen is we'll start on. We won't be in this kind of rain effect boats if we start walking around. Well, certainly walk into really look as a particle system is over there, and that's how you can generate the effect of starting and stopping rain areas. And it's the same with the wind with the hemisphere rather than one second. Have to plug this in, guys. But yeah, this is exactly how that kind of effect is created. So they go. So that's how you can add some kind of snow or rain effect on. If using the correct models and the correct color scheme for the landscape, you can really create some powerful effects. So I hope you enjoyed that one. I'll see you in the next video. 14. How to upgrade Unity to the latest version: Okay, guys, Welcome back. So I've got some good news for you guys. Unity has just released the newest version off the software. The editor has got an update. So I thought I'd record me updating the software and teach you guys how to do that as well . All I did was I open unity, and I was faced with this pop up. Now, if you if you know, presented with a pop up there is a way to manually check it's under help on check for updates. So you just click here on, then click download new version, and that will boot you through to the the installer page. So here we go. I said they're in the previous video that I didn't want to watch the download. The latest version as I was working on current projects. But now the stable release has come out. Then why not? The process is just the same as before. I'm just opening up and find it. Andi, open up the download assistant. It's probably gonna want me to show unity, so I'll just quit that before I do on here we go. So all we have to do is run the assistant. Now, when we go through this time, you can see that a few things have actually changed. One of them is the size of the android. Buildings actually increased, but just same as before. Basically, just choose whatever you want on click. Continue on and down. It will come straight to the computer. Okay. Oh, download this and I'll see you in the next video. 15. Building a car driving app in Unity - Part 1: Okay, guys, welcome back. So it's time to put everything we've learned together on actually create a little driving game which you are watching on the screen now, where we're driving around our own terrain were using mobile phone inputs on. We've got a little particle system for smoke coming out of the car. We've also implemented buttons onto the compass so that we can quit out of the application on jump to an intro scene. So have fun. I'll see you in the video. Now. The first thing we need to do because we're going to be building for a mobile device is actually switched to a more about platform on what this will do for switch to my inspector for a second. There we go. Default, seen loaded. What this will do, then, is it will enable a few off the mobile tools that are included in the unity software. So what you need to do is click on file under to the build settings. Now, by default, it set up to be for PC Mac and Linux. But if you remember, when we installed unity, we had to select additional libraries and this is where all those additional libraries actually appear inside unity. Now I'm going to switch to an android platform light. So now we go on. I'm now going to close the bill window. I'm also going to save the scene as main, go back into the built for things and then add this open scene to the APP. So the first thing that we're going to do is create another terrain. So let's come over to the hierarchy. Right? Click three D objects to rain. There we go. Now, this time I will leave it at the default sides. But I will zoom out slightly, Um, I six huge, and it's actually easier from a height to work with. It's a lot faster processing wise on these easier he would go so like we did before. I'm now going to increase the brush size on. I just want to build a boundary. Silver car can actually dr from fly off the edge accidentally. So I'm just going to go around the map, just give myself some kind of boundary so that I can actually drive over. If I lowered the directional lights intensity again, we can see the terrain more that we go. Onda should be okay. I might I might increase increase it a little bit more. Here we go. Spring this empire. And now we have kind of and many will to drive around, switch the brush just to give it a little bit of detailed definition in different areas, just for a little bit of variety. Okay on. I'm also going to bring out of terrain slightly here, So I've got something to drive around. Like so maybe here here as well. Okay, now we're going to have to import the environmental upsets again. So accents, import package, environmental on this will give us access to the textures again. So it might take a little while this while just pause a video for a second until it's finished importing. There we go. The import of manager has loaded on and income the assets. Now, once this is finished importing, what we're going to do is we're going to then import an additional package inside unity itself, which they included as a demo on one of the assets. Inside the package is a unity car. It's called the Sky Car on. It already has a load of fancy scripts attached to it. we can switch from two wheel drive to four wheel drive. It has sound effects attached to the car, each wheelhouse and audio source attached to it. So you got skidding sound Andi, because it's within the unity system. It also has a script that attach is in the same way that the first person control the dead to allow first to move the car with the W. A S and D keys. So that's what we're going to work with. First, we're going to work with the sky car initially on just get the thing driving around, and then we're going to improve on the overall system. Ultimately, once it's running, how we want it to, we're then going to load in a more about joystick on. We're going to use the more about controls to actually control the car rather than the keyboard. Obviously, as a mobile phone doesn't use a keyboard, Teoh actually work inside a gamey uses tooks controls, so that's exactly what we're going to use. Okay, so that's finished. Now let's go toe assets on import a new package on this time come down to vehicles, so it's the same as before. We'd be faced with the import unity package. Let's just import that's on top on. Once this is finished, our switch to the project and you can see the standard Assets folder will have been populated with everything that we've just imported. So we're going to load in a texture as a base, paint a bit of a rocky surface on the tips of the mountains on, then probably place a few trees down as a few obstacles. Okay, so far, so good. Let's go to the project on Let's apply a texture to our Tareen. So once again, the paintbrush edit textures are texture on. Then we scroll down the list and find the grass on. Uh, there we go. I'm now going to have an additional texture for the rocks, which in this case, we will use the grassy rock selected and then zoom down a little bit. I'm just going to give in fact, yeah, let's keep the past two really low down. So because I still want the green to come through, I just want to make it look a little bit different. As we're driving around our little world, we go. It's just paint over the edges like so on. Then that's out a few trees. We should go for this time. Let's go for the broadleaf. Uh, bring the three density down on the tree size down. Here we go. Know that I just want to have a little bit off an environment for us to actually drive around. Really? Place cells in the middle of the truck will go around it. Bit of a forest in the corner. There we go. Not too many, because this is going to be built from Obama. Okay, so now what I want to do is kind of create a dirt path for us to drive around on our on our little world. I mean, if you want to do, you could go to the asset store and download one of the road packages from there. But then you've got to position the actual three d models. Teoh be height relevant. Andi, snap together for the car to actually drive around easier. So for this this demo purpose, the focus is really on the ability to actually move a car around the map using more about controls and exporting to a nap rather than making a photo realistic to rain for us to actually drive on. So if I go to the paintbrush, I'm going to add an additional texture which we're going to use as the road first to actually drive on. So I just have a quick look through and here that we have some sound. So let's up the sound. And now what I'm going to do is I'm going to click on the sand, bring the brush size down to about about 30. Let's try that on increasing capacity to about 40 on. Then if I just draw a line, it actually looks a little bit like a dirt path. I'm just going to lower the A pass it down a bit more on. Come around the trees, we go and just draw a path for us to follow with the car. I come around here, I could just join the path up there we go for switch back to my trees for a second and a couple of extra trees here. So, like the tree there we go. Now we've got something to actually drive through on. If you're going to fax, he going to have an accident in the corner. So bring this brush size down a tad. Put something on the side of the road. There we go. Now, if it legs a little bit on your device and just remove some of the trees And that's really simple to Dio, you've got the instructions on the right hand side. Look, what we need to do is basically hold down the shift key and click, and he could remove a few trees on. If you hold the control key, then you. If we have multiple trees, you would only remove trees off that certain type. So I can just thin this out slightly just to improve the performance. Look, just like so There we go. OK, so right, we've got a terrain. We've got some kind of route to drive around. Um, all we need now is a car to actually drive around with. So let's jump into the standard assets and have a look at the sky car. So inside vehicles into car into pre fabs on. Then here's the sky car. Now, what I don't need to do is drag that out onto the actual track and then let go. Okay, Now that's created the car for just about click we'll zoom down to the sky car. Here we go. I think this is going to look OK. The trees are gonna look a little bit huge based on the size of the car boat. Not too bad, actually. I think that should look okay Now what kind of sky? Cause not the easiest car to drive. So having a path this wide will actually work in our favor. Let's just have a quick glance at the sky car for a second. You can see this is a parent game object. And then if we expand the list, it's broken down into sub game objects. Apologies. If you going to stay the fun in the background there, guys, right. If you click on sky car, that's the actual model. And then he can expand the sky. I can see that it's broken down into the different assets, so each wheel is individually added. This gives it the ability to have a script attached to rotate the wheel. When you press the W or the s key on the keyboard to actually drive the car. Now I'm just gonna change the body color so that you can see if you wanted to change the hubcaps or the wheels and change the color. It can show exactly how to do that. So click on the sky called Body and come across to the Inspector and then expand this Skype car body gray. And I'm just gonna change mind to be kind of a bluish color that we go. Okay, now this sky Keifer, go back to the actual parent game. Object for a second has a bunch of fancy scripts that have bean built by the unity developers. Now the main one is the car controller, and it has the ability to switch what type off vehicle we want to use. I'm quite happy to use a four wheel drive one at the minute. Now the green box is the collider so that the car can actually hit other objects that also have a collider such as the trees of the terrain itself. You can also adjust things like the talk, which is a power, the speed, the stopping speed on the break power. You can also alter the sound effects if you like. Andi, The guys have already included a car use control script. So in the same way that we had the first person controller integrate with the keyboard controls. The car has got that same feature. All we need is a camera to actually follow this thing around. Now we have a camera, but it's positioned somewhere off the off the grid somewhere over there. So what I'm going to do is I'm going to direct the camera on making a child off the car. Then I'm going to reposition it so it will appear in the absolute center of the vehicle like So Now all we need to do is move the camera back on up a little bit. To do this, I'm going to use the new tool from Unity, the new transform tool, which is actually a multi tool off all the individual tools. So if I click, this looks a little bit complicated at first, but it's not that bad, Guys. The inner arrows Here are the move toe the globe represents. Rotate all on the squares, represent the scale tool. So I want to move the car back on the set. So it's moving back. One of the camera. Sorry, not the car on that. I'm going to raise the camera with the why on this arrow here like so Then I'm going to grab the red Ex access under struck that down to tilt the camera to give us the right kind of perspective that I'm looking for. That's all we have to do now. The only thing is because the car controller on the kind user controller work using the W A and S and D keys. Now at the beginning. If remember, we switch the build settings across. So what that will do is it detects if we're using the android or iPhone set up aan expects a touch control to make the car actually move rather than the keyboard. So if I press play will not be able to actually move the car with the keyboard, There we go. All we have is a sound effect of the engine, which is part of the actual script down here. However, if you come back up to the standard access on, then go into cross platform, go into pre fabs. There's a prefab here called mobile Single stick Control on. When I drag this out, it will create a converse with a bottom which we can actually drug around. Now, when I go to the game mode. You can now see this bottom. He also has a jump bottom, which we don't need for the car. So I'm just going to delete that for a second. Yep, that we go. OK, Andi, there's the single stick controller. Now, if you can't see this is because you are a not set upon a mobile build setting on. Be up at the top, make sure mobile import is set on enable. Otherwise, this will disappear now because the script attached to the car is expecting a an input from the mobile steak rig. That means that when we press play now, I can use this and simulate a thumb. Press on a drag on an iPhone or an android device to move the car forward like So way go on , we are off driving around our world. Get ready for the skin. Waco on the low. Yeah, no, very good baby. I need to concentrate more my driving rather than actually talking. Now this is looking great, guys. I mean, if we went to the asset store on drag down a few houses, maybe a stadiums, people's models, you can imagine the potential of building a little little environment driving around it. Now, this is the easy way off doing it using the sky car, which already has all the controls. Boots. What about if we don't have a car model or we want to use a different car from the asset store that doesn't have all this fancy cold attached to it? Well, let's have a quick look at what we need to do. If we go to the mobile joystick here, you can see it has a joystick script attached to it. So let's just open that for a second, okay? Just opening up. Okay, so now that's opened up in in model develop. Now, down here is where it uses a class called the cross platform Input Manager on it uses a virtual access for the horizontal and the vertical. Now, this only works on the more bowel side in the manner that we actually want to use it. So if we weren't set up in unity to use a mobile platform, this script wouldn't actually work. Now, the name of the library is unity. Standard assets, dots, cross platform inputs are just going to copy that for a second in fact, Ali, I'll leave it where it is because we need to copy something else first. So what I want to do now is get rid of the sky car. So let's delete the sky. Car on the camera was attached to the sky car, so that's why it says nukes. No cameras. Now I found a really cool car. If we jump into the asset store for a second there we go now in my download manager. I recently downloaded Axum cool cars for us to use in this demo project called Cartoon Hot Rod. So that's what you guys need to type into the search bar. Just look for cartoon hot road Cooper on, then Click Download, and it has all these cool little cars that, well, that we're going to drive around. So let's import the models into into our project. 16. Building a car driving app in Unity - Part 2: now what Unity actually does is uses a command called get access. Okay, Now on the unity website, in the documentation, they give an example on how to use the class on actually capture input devices, for example, a click of a mouse or a press of the space bar. So we're going to use that. But we're going to change it to send a signal to the mobile joystick rather than expecting a keyboard. So what I want you to do while this is just importing Google for a second on type in unity yet access that will take us through to this input dot Get access and it will give us an example. Snippet of code. Okay, now, what this cold does is a class just like we've used before. And it has a float which is a number toe, a decimal point. And that's the speed. He also has another one for the rotation to turn left and right. And then in the update statement, what it does is it checks if we've pressed three the corresponding key for vertical meaning we've pushed up or down on the joystick. I'm always pressed w or s, which are the default commands for vertical up and down. Or we've pressed A and D, which are the horizontal default keys, or we've moved the Joy State left. And right now, by default, it uses the input class library, which is the keyboard. So we need to change this little bit here. And in theory, our, um our joystick should receive the message in the same way. Let's just get rid of that for a second. My heart is still coming down, so just I'll just pause it for a second. And I'll come back to you guys when this is completed. Okay, so my assets have now come down that we have the cartoon hot rods here for switch back to the seed. I just open up this folder on going to the pre fabs hero. All the funky little vehicles now the difference in the different types. I just make this a bit bigger. Here we go. They have got a lower version. Polygon counts based on the detail off the actual car. So if the car is a base car like this one, then it's a lowest polygon count. So if you've got a slow a mobile phone That's the type that you want to get. The ones with the engine on the top or the middle ground and the ones with the engine on the top on the exhaust coming out of the side like these bad boys. Now, at the bottom are the ones that slightly higher. Now all I want is this one here. I'm going to use this car here and pull it out onto the scene. It's a little bit small, so I'm going to while my transform multi tool selected, I'm gonna make it a little bit bigger. There we go. Now, if I aren't a new camera target as the main camera and make it a child of my car, I can do exactly the same as I did before. Wonderful. Reset its position. And then I'm going to move it back on up slightly on rotate the camera down, car up a little bit more. Maybe. Let's have a look. Yeah, that that could work. Okay. So, back to the scene. Now, we need to actually make our car move when we actually press this joystick. So the mobile joystick, remember, has this joystick script attached to it, which if we jump back into model developed for a second. Have a quick look. The name of this group, this names based library is unity, standard assets, cross platform import rather than just the general input that we saw on the on the website second ago. Now go to the car and add two things. The first thing we need is a rigid body so that it will interact with physics and be able to actually have a little bit of weight for press play. It drops through the terrain and that's because it has a rigid body to give it rabbit IQ. But it also needs something called a box collider. Now I've added a box collider to the actual car itself. There we go look, and that's because the terrain also has a collider. So if the car has a rigid body under collider, that means that it will sit on the on the unity terrain itself. On the two colliders will prevent the car from going through. The only problem is the collider is bigger than the car, so I need to adjust the collider here. I'm just making a little bit smaller and then I'm going to bring it up on the Y to fit the wheels. I'm also going to make it a little bit bigger on the axe. Run one. What was that? Sorry. There we go. So that it covers the front of the castle can actually drive into things. That's about right. Why no. Okay, now, if the car fails to move or it looks like except to find the ground, then you just have to adjust the wide position off the collider to make it look like the wheels off sat on the on the ground a little bit better. So now we've got our box collider set up on the car. Has gravity applied with a rigid body. If I press play, it should sit on top of the terrain. There we go. Perfect. And it looks like it's sat on the ground for me. So I think I'll gladly collider about right. Okay, so all we need to do now is making so that when we move the joystick, it will send a signal through to anything that has the correct script attached and move it . So that's adding components on. We're going to add a new script. I want to call mine. Go, baby, go! There we go. Because that's what is going to make the hot rod do so once the little circle has finished in the corner, the script is ready. Open it up in model develop. Here we go. And I'm just going to paste the code that we've just lifted from unities website. There we go. So we've got the two floats up at the top for the speed in the rotation on. Then it's expecting the keyboard input where we want to change this. We want to use the unity standard assets, cross platform inputs. So open the top. Just add that library like so on. Now we've got the unity standard assets cross flood platform imports been a mouthful. That means I can copy this on change this in port rather than using the generic keyboard controls to become the cross platform input money jet. Then we go. Now when I move the joystick on, it sends a message to the unity system. It will be received by this car in the OECD A statement when I push up, then it will move the car vertically. Hope meaning forward in the world now One thing to consider is that these variables are public on that's handy for just save. Save the file for a second, because if we click on the car when we try this out, if the car is going to slowly, we can increase the speed of the vehicle here until we're happy with the velocity that the vehicles moving up. I'm just going to start it up. 40. Save the scene on Let's see what happens. So now this has a script attached to receive the joystick commands. So let's press play on. Let's see if the car will move now, but your mind it won't have the sound effects like the other car did. But if I drank this pope there we go at speeds. Not bad, actually, you fight. I think the speeds pretty much perfect. Now, if you feel it's too easy, then that's the rotation speed. That would need Justin. If you're happy with how it is, I think this is pretty much perfect guys, If you're happy with how it ISS, then you can leave it exactly how it is on. There we go. Look, we have created a custom world. We've made a little bit of an environment on a track, and we've used our own model on Integrated it with unities, inbuilt joystick controls. The only problem with a drastic said bit ugly. So I'm going to show you how to change the cosmetics. Now what we want to do is come down to the mobile stick control on the actual joystick, and you can see the image script is attached as a component in the inspector. Now it uses the image that's imported from the cross platform tools for click this little dot here. Then these are all the images that were included now attached to this video. If you move the mouse over to the left over here or on a mobile, click the three lines. Then you be able to pause a video for a second and you'll have a sidebar that drops in. And I have attached a graphic what you can download for using in this video. Now I've got mine sucked on the desktop, so I'm just going to get it. So what we're going to do is import a to D graphic on, then set it up so that we can replace this image on the way to imported graphic is to right , click in the project panel down at the bottom and then go to import new asset, navigate through to where the answer is minds on the desktop on I've got this little steering wheel, PNG here, so I'm going to import that. There we go now, unlike with a two D platformer, because we're working in a three D world. It treats every image, the imports initially as a texture so we could use it as a ground, or we could paint the road with it. However, the in this particular case, I wanted to be tracked a something called a Sprite, because it's for the two D environment on the graphic user interface. So while the steering wheel selected, move across in the inspector to the actual texture. Type on, change it to be a two D user interface active and scroll down on check the size of the graphic. It's 256 by 256 so there's no need for the default to be 2048. Were matters are bringing down, which will compress it at the right stuff size that we go on the final size have dropped from 85 to 64. Now all we need to do is select the mobile joystick on Go to the source. Image on our steering wheel has appeared. So there we go and how we've got a cool little steering wheel that's appeared on the screen . Now meet personally. I hold my phone in a landscape position on. I like to use my right thumb rubber my left thumb for certain things unless it's a driving game. So I'm happy with where it is, but I want to show you how you could switch that across, go back to the scene for a second and switch to two D and double click on the mobile stick control. That's actually a canvas that's just be named mobile stick control. So because it's a converse, we need this to resize with the size of phone. So what I need to do is I need to add a kind of a scale it to this. So typing that compass and she was cumber scaler on, then changed from being a constant pixel size to scale with the width of the screen. And then we're going to set what I've a reference resolution you want. Mine is the iPhone, the iPhone six s, which is on 1334 by 7 50 you'll notice that the steering wheel has shrunk in size. We'll have to do is actually click on the joystick. Now. Andi increased the size like so and then positioning where I'd like it to be on the actual scene are now on my game. Change this from free aspect to be for the iPhone six landscape, and it will give me a visual representation off where the thumb stick will actually appear . Now, if you think that the thumb stick is moving around, too much is in. It can move right over to the edges of the screen. And you don't want it to move that much with that much freedom, for example, like so if you watch whether thumbs that can go, this looks okay on here, but sometimes it can go right to the middle of the screen. Now, the way that you change the range off this is here on this side, and you can adjust the movement range, which will prevent it from moving with such a vast diameter, Really, for lack of a better word. So there we go. So we now have a terrain. We've got a car that we can control with a stick. How about we add a little particle system? So the exhaust to make it look like it's got a little bit of smoke coming out of the back? Seems we've already have a look at particle systems, so it's import the particle systems package. Here we go, and now the assets will appear in here. Now there's an in built prefab inside the particle systems for smoke on. It tends to work really well for car exhausts in my my own personal experience. So that's the one that I'm going to use. Come back to the scene out of to day and shipped down to the car. He would go right? First thing I want to do is select the car, go to the assets, go to standard accents, particle systems, prefab on. Then we have steam smoke as a smoke look. So let's drag the smoke out and place it on the scene where the exhaust ISS put it about there just under the bumper that we go so well. The car is actually looking like it's overheating at the minute on the particle systems huge. It just needs a little bit of an adjustment. First thing we're going to do is change the size. He would go in the shape. Let's bring down the the heights of this of this beast. It's rotated. First, it's facing the right direction. At least there we go. Now. If I increase the gravity, then it will stop firing up like fire, which is a default for this actual prefab to make it look like smoke from a fire. So where's the gravity? Roberti modified? Let's put it to 0.15 There we go. Okay. Just needs positioning a little bit back underneath the car. I'm going to change the the angle. Bring that in. I'm going to change it from being a cold to being a box on going to lower the commission down to 10 that we go on. I'm just going to change the size to be worn on two Onda win the game on. Let's see how this looks. That's too small. It looks OK in the editor, but it doesn't stand out on when I actually run the game So let's increase the rates again . Try 20 and see how actually runs in the game where we can see it go. Well, I forgot to attach the particle system to the car we go, we just drove away from it. So let's have a look. How it looks now. Cool. So off we go on. If we stop, then we can see the smoke again. If you increase the emission rate on the size of the particles, then you actually have a trail of smoke. Are you driving around? Let's just duplicate this car for a second, which will include all the scripts and everything. So it will also move when we actually move the mobile joystick. We're just position this one in front of us and press play. Now we could actually drive around and see another car in front of us, which is kind of cool. Well, I need to cut the corner. I'm a winning. Brilliant. Okay, so this is the foundation on fundamentals for how you could build your own little car game on its using all the skills that I wanted to put in your little unity toolbox to set you up with a solid foundation so that you can now expand on this and create whatever you want in the future. The last thing I want to show you before we build this to an android device is how to transition from one scene to the next so you could have an intro splash screen on. Then when you click start, it would load up the game on inside the game, you be able to exit back out. So what I want you to do next is I want you to save this exact scene on. We're going to use it as an intro Templar. The only change that we're going to do is we're going to reposition the camera. So let's have a look for decent camera angle about here, okay? And now that's the shot that we're going to use for the intro scene. So let's save this as intro on then. What we're going to do is we're going to move the camera out from being a child on. Then I want you to click on the camera, go to game, object and click align with view, and that will move the camera toe. What? I'm actually looking at 17. Building a car driving app in Unity - Part 3: on. Then I want you to click on the camera, go to game object and click Align with view on that will move the camera toe What I'm actually looking at. There we go. So now the camera is looking at our exact position of where I wanted it to. I'm not going to save this scene, which is the intro scene. I'm now. When I press play, we should be able to see the smoke from the car. There we go. So I got a little bit of life. Now, if I add a wind zone over Well, it doesn't really matter where we had the wind zone. It's going to blow everywhere. Three D objects, wind zone. There we go. Press play again. Now we've got some life in the trees as well as the smoke. Okay? It's a little bit strong. That's lower. The, uh lower the turbulence on the main down a little bit and try again. I want some movement, but not too much. You see, There we go. That'll do. That'll do now. We don't want the Mo Vastic control, so I'm going to delete that. Now bear in mind, I'm working on the intro scene, not the main. Seen that. That's why we saved the as before, back to the camera for a second. Right now, what we need to do is add a canvas over the top so they can have a bottom positioned on the screen. So let's right. Click on and go down to user interface and create a button that will automatically create a canvas for us. There we go. Look, go to the canvas, change the scaler to scare with the width and the height, and change it to the iPhone or whatever you're using as the settings. And after come back to the two D view the book, click on the compass, we can see the the button in the shot. I was too small, so I'm gonna click the button, increase the width to be 2 50 In fact, increase the wit to be 3 50 on the height to be 100. There we go on. Then if I zoom in, you can see the text is inside. As a child, click on the text on I'm going to bring this in. While the on the Resize tour was selected for the U element to bring in the edges and then I'm simply going to click Best fit. I'm then going to click inside this text input area here on right start game. We can change the text color to be white and then come down to the bottom and other components. And we're going to add a shadow and change the distance to be too on the minus distance to be too as well. Because if then go back to the button on I changed the normal color to be a shade of blue to fall in sync with the environment. When I press play now we can check the position of the start water. Then we go look So that's about right if I add some text across the top now. So if I zoom out for a second on school there we go on the campus right click and create a U I text element. I'm not going to stretch them out to be nice and big. Click on the wreck, transform hold shift on Ault to set the pivot on position and clipped the top center, then just going to move that down slightly, like so on inside the text area. I'm going to write the name of my awesome Carl demo Oh, card game. Even we don't want to call it a car demo in the actual app. Let's send to that vertically and horizontally on changes color to be the same blue rhino or similar blue. Anyway, click Best fit on It goes big. That's making bold. I'm actually going to override the best fit. This time I make it much bigger like so Now if you want to use a different font, or you have to do in the same way the U imported, a graphic will be to right. Click an important new asset, and you can import a font in the same way on a Mac. You can hold a commander and space to open up the spotlight and go to your fun book, which is here on. Then all we have to do. It's like the font that you want, right click on Do reveal in Finder, that showing finder on you'll be able to make a copy of that fund, then onto the desktop and import it. Or you could even showing find it, like so on. Simply Dragon. Drop this into their on then that would allow unity to be able to use these fronts as well . One trick is to click on the front and in The Inspector changed the type to be dynamic if it doesn't look very good quality. Okay, what for us? I'm OK with this for now, So let's go down. Let's add a shadow to this as well. The Shadow is going to be white on going to make it three on D minus three as text is bigger on, just save it and give it a run. There we go. We've got our awesome A card game with not the greatest of France, but I'm going to make it a little bit bigger on. Let's see if I could make it look any better that we go. Awesome Game on. Now. I just need to send to this so I just reposition it back into the center that we go. It might even be better the other way around with the white text. Let's try it the other way around. Let's give it white texts and blame shadow, so if it stands out a little bit more when it's actually on the scene, save that and try that. Let's have a look. Okay, cool. Or some card game. And we've got to start button or we need to do now is actually make the bottom work when we press it. So lets out a script that will control the scene. Now, one more thing. First, though, I want to make it so you can quit the app on your device. So down to the U I on, Let's add another button. And I'm just going to position this in the corner, like so make it a little bit bigger. Bring it in, and I'm going to change the tax that's written on it to say quit. I make it a little bit bigger that we go. Okay. I'll leave the but in the same color and everything. I'm going to lower the height, though. It's a little bit ugly. Well, make sure you're clicking on the bottom of the text right now. We're ready for a script. So what I'm going to do is I'm going to right click and create an empty game Object on this . I'm going to call seen controller. Okay, now I want to add a component here. Andi, I'm going to make a class called screen controller. It doesn't have any impact on the name here. That's just in the hierarchy. So I know what it is. So that's creating at the scene controller script. Okay, now what does the screen control I need to be able to do? It needs to be able to start the game and quit the application. So let's open it up in moderate develop. Yeah, here we go. Now, in this particular case, we don't need the start of the update function, so I can get rid of both of those. But we do need, though, is we need to create our own public void, which I will call change level, like so on. Then we're also going to create another public void, which I will call Exit game. You may wonder why I always write the first letter lower case, and then every other word upper case. It's called Camel Case on. It's a very common technique to use when naming functions in code. Okay, now, Unity has some seen tools that we can tap into to actually do this on their inside the scene manager. So we need to import the month the library that is the unity engine. Seen manager. Well, seen management. Sorry. Here we go. Now, this library has got a bunch of functions similar to the debug log and things like that that we saw previously. One of them. If I change the level, if I want to change the level which effectively will switch to the game which is called Main, then all that have to do is write in. See manager load scene on, then this expects the name off the scene. Now I can simply right. I mean, here boats. I'm going to be clever. And what I'm going to do is I'm going to pass parameter in so that we can use the same script when we're on the game view to come back to the mean the main menu if we want to. So if the Lord seen requires a string, I can pass in a parameter here, which is an additional bit of information, but I'm going to pass in a string called s to represent the scene. So instead of writing a string here, I'm just going to use a variable s. That means that when we call the change level, we have to tell it what scene we want on. It would dynamically do that now. Likewise, Unity Engine also has an application class on the application class has a quit function. So all we have to do here is called application quits. On. That will be the equivalent of pressing the button at the bottom of an iPhone or an android device. And it will actually make the back, make the game jump into the background mode. Okay, cool. So let's try it out. So let's save this on Closed model developed for a second. Let it update for a minute on. Then all we have to do is hope the bottom upto access this script. So if I click on the start game button making sure I'm on the button and not on the text, then if I come down If you remember, the buttons haven't on click event Handler. If I click the plus, it asked for a game object which contains a script that we want to access the function on so we find drug scene control in. I can now access my script for the scene controller on because I made the functions public . Then I just come down to my change level on that will change to the name off the scene that I want, which is main, however fresh return. If I come on the quit button this time, what I wanted to do is call the quits function. So let's drunk the scene money during again. Go down to the scene controller and click exit game, save the level on, then back to make sure in the top level of the assets. Now, throughout this little introductory course to using unity, we've been using something called pre fabs, which are basically template game objects which already have things attached to them. Or now we're going to create our own. We're going to make our screen control a prefab so that we can use it very simply in another scene. Or we have to do to make something a prefab. It's click on it and drag it into the project panel bottom, and now the scene control has become a prefab. Now that means that when I drag it back out into the scene, if it did have a three D object, it would appear in the exact same coordinates with the exact same scripts attached to it. So I jumped back to the main seen out, save this one. Jump back to the main game that would go. If I click on the scene controller, I could drag out my prefab and there we go. Look, it already has the scene controller attached. Oh, I could also do with a quit button. So that saved this and go back to the intro and do the exact same for the quick button. This is a quick bottom, which I'll rename Drag it down and let go. Okay, so let's save that and go back to the main scene. Okay, so now if you remember, a button requires a canvas. We can either create another campus or we can use the one that already exists for the steak . So let's drag and drop our quit button onto the canvas that we already have. Onda Boom! It appears exactly where we want it to. I don't actually want it there, but it appears where it expected to appear, and with some of the quick button up and placing in the top right and corner, just so that it's well off the way we don't hit it accidentally. But I'm also going to right click on Duplicate the button. Our position is over in the top left and I'm going to rename this button menu change text inside to say maine, meaning the main menu The intro scene. Making up a case too much on going to change the text color on this one to be white on the button itself to be a similar blue to the joystick. So look, move you around about that. I'm also going to change the quit button toe, have white text she far If I go on to the text, change the text to be whites on the button Red. It's a bit too aggressive. Borgoff like an orange Akula. There we go. Big talker. Okay, so now we have a go back to Maine button and a quick button. All I have to do is make it so that when I click this button here, I don't call Thea the quit function. What I do is attract the scene controller in on. I changed the level and go back to the intro scene. There we go. Now, when you create a prefab such as these buttons, you will have to reconnect the scene controller on the functions again. So it's got to quit. I was dragging the scene controller on Let's call the exit game function. Now. This doesn't work in the editor, but they start game and back to the main menu should. So let's give it a bit of a run. Here we are. So the car's driving around looks good. The smoke's coming out nicely. I think this is to now pretty good guys. I really like it. Okay, let's quickly main button Andi, but we've got an error. Yeah, I forgot to do something. The Ari says the interesting couldn't be loaded because it's not in the build settings. So let's go to the intro scene. Go file, build settings on at the open scene. It won't work and lacks you out the scenes inside the scene manager. Now I want they see the intro seem to be the first thing that loads when the APP launches. So I need to click and drag that above the mean one on. Then close it, and now the problem should go away. So let's press play. Here we are. We've got a cool little intro scene. Smoke's coming out of car. We got a bit of life in the background on We click start I am Boom, we're on the game now. Don't worry about the color that's called baking on while you're in the editor. When you switch the you switch scene to scene, it's unable to actually run the run, the baking on the lighting effects. Okay, let's fix this little issue. It's sane that there is already a virtual access named horizontal registered Onda vertical one. Now the only place that we've got this attached is on the car. So if I disable this, I think it might be more of an editor issue compared to actual mobile issue with the game running through the different scenes. But if I take this script off in the intro scene because we don't need to move the car, especially if there's nothing to actually move the car with, then that one factor just remove the component. There we go. Now. If I save the scene Onda, we run the game again. There will only be 11 version off the class eso We don't need to have any issues. Here we go. Let's start the game, Onda we can move again. Fantastic. So there you go, guys. Um awesome. In the next video and the final one of this many unity introduction for absolute beginners , I'll teach you how to export this cool, little funky up so you can play with it on your mobile phone on on for an android or IOS device. Andi, don't forget. Feel free to jump into the asset store. Um, I don't know, maybe grab a couple of ramps or something to compete this a little bit more fun. Okay, so that's it for this video. I'll see you in the next one. 18. Bonus Audio Video: Okay, guys. Welcome by I've decided to put in a little bonus video just before we get to the build. Because I've come across some music that fits the game on a cool sound for a car horn. So why no. Okay, so the first thing I want you to do is come over to the left. Inside on download. The resource is that I attached to this video, there's an audio track and a couple of graphics. Okay, so mine are on the desktops. I'm just going to right click import the assets. I'm going to go to my next stop on. I want you to get this corporate truck. The horn on the icon having click import. Okay, So they've arrived inside the project manager. Let's switch the horn graphic to be a sprite so that it can actually be rendered a sprite, and I just make it 1 12 fact, I can make it 61 20 x five and apply that. Okay, then I want you to click on both audio tracks, and I want you to come over here and force them to be mono because that will work better on a mobile device and then click Apply will also lower the file size slightly. Okay, so that's done right. First thing we need to do, let's duplicate the quick button like so and call this horn. Then what I'm going to do isn't want to move it down. So it's in a position around where your thumb will sit a little bit lower, maybe about their on. I'm going to make it equal width and height. So the height needs to be 1 60 as well, because we're going to swap the you I sprite to be the knob, Which is that? Okay, so it will be around button to press. I'm also going to change the color to be black, No white sari, because the horn will be added after because now what I want you to do is get rid of the text inside by deleting it on. Then I want you to right click on the horn and add another you. I image inside that and it will be centered in the middle. Then I want you to swap the sprite for the horns. He can drag the horn out and replace it over the source image, like so just to make sure it's not distorted. I'm going to click, sat native size, and then I'm going to scale it up slightly like bats. Okay, so now we have a whole button that is ready for us to press. To make this work, we're going to need an audio source. So on the horn itself, on the button, I wanted to come down and add an additional component. That is an audio source. Okay, on, then. The clip that I want you to use is the horn eclipse. I want to drag that across and drop it in, but dont play on awake. We want to control when we play the sound effect. Okay, so that's done. Now, what I'm going to do is on another empty object which will, before the background music Okay, on this will have its own audio source as well. Which will be Vicks truck here. It will play in awake, and I do want it toe loop. Okay, So that means as soon as I press play now it has an audio source. This will automatically play. However, the bottom needs a little bit of cold. Okay, so now what I want to do is write a mini mini script, which will get ahold of the component that's attached to this horn game. Object on, then play the sound effect when we tell it, too. So come down to the bottom while the horn selected on other components. And we're just going to make a scripts called Play Horn. Okay, on, then open that up inside mono develop. Now what we need to do is get ahold of this component. Andi. When we call a function, I want to play the sound. So the first thing we need to do is create an audio source called Audio. I'm an inside the start function. I want to tell audio that it's equal to the component that's attached So audio source. There it is, Andi. That's how we get a hold off the audio source component. So now all we need to do is create a public function so that we can call this, which will be we'll call it beep. Why, no. On when BP's called, all it will do is get ahold of the audio on. It will play the sound effect that's inside of it, so save that and you're back to the scene then click on the horn and then come across to the button script on And where it say's seen control that we're going to swap that for itself on. Then I want to go to the function on. I want to go to play Horn, Aunt Select beep. Okay, Now, I want the background music to be slightly lower in volumes, and we're to bring that down to our 70% so that we can actually hear the horn. When I press it, Save the scene on Let's give it a room. So get ready for the music guys. Uh oh. Here we go. Off we go. Just Hey, happy driving, guys. And away we go. Look on. If I If I press the horn. Hey. Okay, guys, just just a little bit of fun for you just to just to learn how to do the audio really on and have a little bit of fun. I'm going to now show you how to do the exports of the mobile device so you can have a real play. We've both your thumbs and drive around your little world honking the horn. Cool. I'll see you in the next video 19. Exporting to Android in Unity 3D: Okay, everybody, welcome back. It's time to finally put our many application that we've just built onto an android or an IOS device. Now, before we do it, I want to just tidy up a little bit before we actually export the package. So what needs to come down to the project at the bottom on? What we're going to do is we're going to right, click on, create a few folders. Okay, So the first folder is for the scenes. Now, what I want you to do is get the two scenes, Andi, drag them inside that folder. Then we're going to create another folder for the audio. And then we're going to click on the two audio tracks and drag that into that. We're going to create a folder for sprites, which are the images. I click those two. Then we need to fold for the scripts, which we can drop the three scripts inside on Finally, one for objects. Okay, so right click folder. I will have one for the objects aren't. Here we go now. If this were a bigger project, then I would have been creating the folders as we went along. However, this was more of a tutorial set aside, you know, So it's okay to do it at the end like this. Okay, right. So first things first. What we need to do is make sure that unity is set up to export to the correct platforms. Now there's a little bit off a set up time now, but once it's done, it's done forever, provided you don't on install the software. So this part can be a little bit tricky, so just watch what I do here. What I've done is I've gone into the unity preferences. I think on Windows. It's edit preferences on. I want you to go to the external tools. Now come down to the bottom of this section on here. We have three packages now. The 1st 2 are the Java on android packages, so that unity can export as an X T K file. The last one The end. Ikea is what Apple requires if we're using something called ill to see PP, which is what we will be using to exports apple. So if you don't have thes set up and he need to click the download link, save the packages into a folder that won't move. Won't go anyway. Aan den, Browse through and hook these up. Otherwise, when you try to export and build this, it will fail. Okay, Now, just as a heads up the J. D. K one Lee Java one. For some reason, I had a problem installing version nine. So I'm actually using version eight. So it works perfectly fine for me. If we could download Link, I'll show you for a second. So the current version is nine. But it was clashing, however, that said that waas on the previous version off unity. So I've just left mine alone because it's still works. So long story short. If you don't have thes pause a video on go and download these on Get the package ready. Okay, Now for everybody else. Let's go Filed on build settings. Now here we are in were set up for android at the moment. Now what we need to do is we need to go to the player settings which will give us the information in the inspector on. What we have to basically do is go down these panels. First of all, we need to give the app a company name so I'm just going to call mine A are gamer on the product. Name can be a card game. Okay. Now, if you want a default icon so that it's actually on your device with the custom icon, this is where you would put back. So for example, I could click this and I could choose the steering wheel icon. I'm just drop that in there now as we go down. Like I said, what we have to do is go through each of thes tapped menus. I'm just going to minimize so you can see the menus. Okay, so the 1st 1 is resolution on presentation. This is self explanatory. However, in this particular case, because off the set up on the layout of this game, I only wanted to be available on landscape left or right. Everything else can pretty much say the same. But I don't want it to be enabled for portrait as it will mess with the layout. Okay, down to the icon. Here we go. Look, as I added it up at the top, it's automatically created it in all the different sizes. For me, that's nice. A splash image. So when the, uh when the game first boots, as at the moment, What will happen is it will say, made with unity or in your case, it may say, made me the Unity Free edition. This is where you would add a VR splash image on. If you want to write a logo as well, then you could add a logo. So I just throw the wheeling again just just for demonstration purposes and show you what happens on. I'm going. Teoh want to hide the unity local, so it just shows mine. So here we go, there we go. So as a game loads, that's what that will do. Everything else is it's fine for me now. The one that is important is on other settings now. It will not work on a phone if you don't change the package name, so you have to change the package name on its a good idea to make it much the name of the company. Now the structure is like a website address in reverse, so it's calm. Dots the name of the company dots on, then the name off the actual game, so this one could be card game. Now be careful because once this is set on its in the Google play store later on. This can't be changed, so bear that in mind. Okay on. Then, as we scroll down the minimum, a P r E level basically decides on which devices this can actually run on. So because we're using a three D terrain, I'm probably going to use lollipop a za minimum on that That's basically down to older mobile phones. Not really having the rum and the power for this kind of this kind of set up. So yours may be a little bit different. I mean, the device, the chip inside the actual mobile phone, the default one for me on my Samsung is an RV seven. So that's the one I'm going to choose. So when we try to export this, if we hear any problems, the device filter on the package name are the most common problems. Okay, Now the rest. This particular game doesn't require Internet access. It doesn't need to save any data. I don't really mind where it installs it externally internally, but that's what those features do. This part here has been automatically written into unity because we're using the mobile controls on one little addition in this particular case, there's a drop down here to pre load assets. Now, if I just put a warm in here, what I'm going to do is I'm going to drag my terrain into here, which means that the terrain will load upon the device as the phone boots the game up on. That means that it doesn't have to load it. When it first goes to the main seen Andi, it will prevent a Ram spike. So if I jump into my objects for a second now, we go back to the player settings, so come down. Here we go. So I'm going to drag the terrain into that so it will actually load the terrain as the games booting. I make it a little bit easier on the on the devices memory. Okay, so the last one is publishing settings. I mean, I know it's not the last one, but these are for VR. Onda augmented reality. We're not using that. So this is the last one for us now, Um, here at the moment, we can't export this to a device. If you plugged in a Samson or any android phone via USB cable. You could click, build and run, provided your device is indeed book mode. It will actually also install the up on your device to test when you want to, um, at this to the APP store. Then you will need to add an additional file to the package, which is called a key store is basically user name and password bond. That means that you are authorized developer to actually be allowed to upload new versions off the APP to the APP store. So if you wanted to upload to the APP store, you would have to create a key store and click on Browse Key Store, which would create a user daki store file in the same directory that the actual up is. Then he will ask for a default, using him a default password. So I'm just going to punch in a password fresh we'd send that would go, I'm now I can create a new key, so basically this is creating an account inside your own up. I mean, that's the easiest way to look at it. I'll just call this demo key now without the password for the key store, you will never be able to upload a newer version of the APP again. So be careful when you're creating this, that you will remember the password. Don't give it anybody. I'm a developer. I'm currently in Barcelona, which is in Barcelona Are the country code is 34. Okay, so now I will have created a key. There we go. So that will save the user dot key star file. Now, when I'm in the publishing, I can choose my key here and put my password in. That means now when I click build and save this up to the desktop when I go to the Google Play store, it will run nice and smoothly and it won't give me any error saying that it doesn't have a key store key or no authorization or authentications being included when uploading the up. This is what it's referring to. Now, if you just want to do this as a test and you don't want to upload it to the APP store, that all you need to dio issues unsigned, which is the D book mode. OK, right. And then there's two ways that you can get the up onto your phone. The 1st 1 is to now click build Andi. I'm just going to call this one android, and it will save it wherever I want someone to say this to the desktop. I'm safe. Okay, so now what it's doing is it's It's converting all the cold within unity into the relevant cold That's an android device can understand on. It's going to save the a p K AP file to the desktop. Now there are two ways to get it onto your phone. You can plug your device into the laptop on. Then, when it pops up in the finder down here, you can simply drag it onto the phone, disconnect the phone on, then simply navigate through the file manager. I'm installed the up that way, but I'm not that lucky. My phone doesn't appear in the finder list. So what I have to do It sets my android device into debugging mode. And that way, all I have to do instead of clicking build is I click build run while my device is connected with the US Beast cable. Once it's connected with the U. S B cable, then Unity will look for the device and automatically install it onto the dashboard of my device. Now I'm aware that not everybody knows how to put their phone into debug mode. So what I've done is as a resource from the left inside, I've attached a link to a website that will show you based on the version of the Android software, the half exactly how to put your phone into debug mode on a step by step basis. Personally, I think that's the best way of doing it, because you can just simply plug your android phone into unity directly with a cable. I'm hit building run, and it's done. One thing to remember to give you guys a swell as a heads up. All my students from you, Demi our parts off a Facebook group. Let me just load up the screen for a second. Here we go. So this is the Facebook group that is for my students, who move everything out of the way. Now in here, people talk amongst themselves. They pull screenshots of everything they've done. It's called the You dammit Mobile Development group. Are you guys are free? Teoh, feel free to add yourselves to this on. You can ask any questions you compose screen shots and interact with community off students that are part of my you Demi courses. So just a heads If I thought I would show you that while the software was the story, Okay, right. Are pause the video and come back when the A P. K. Is built. Okay, guys. Great. So here we are. Look on my desktop. Just minimize unity for a second on my desktop, we now have an android. A p k file on. That is what would need to be dragged on drops onto your device. Or he could email it yourself. Download it is an email and install it that way. Or you could do what I do, which is set my phone into debugging mode. Plug it in viral USB on. Instead of clicking build, I click, build and run on. Then the game would load straight onto the device. Okay, So brilliant. That is how we do Android. How about I, Wes? Well, first things first, let's switch the build setting so that we're working on. I wax now. This could take a little while. So once again oppose the video, not come back to you guys 20. Exporting to IOS in Unity 3D: Okay, everybody hit it finally switched across to the iPhone iPad version. The IOS version. Right before we start this one, you're going to need some additional software. If you don't already have it, you need to go to the APP store. Download X cold now. Unfortunately, it's Ah, Mark only piece of software, but that is what the require to actually build apple IOS device applications Now. In the past, I have seen a Windows version I think was called Fire Box or something like that. I'll have a look for it on added in the Q and A for finding. But for now, here we go. So same scenario, we need to go to the build settings. This time we are building for IOS. So what I'm going to do is click on player Settings on the name on the product name are the same. The resolution remains the same. The icon remains the same. So does a splash image. The deeper gain on crash reporting can remain the same. It's the other settings that always needs attention. So down we come on the bundle. Identify. Look, that's what we need to change somewhere to change that to the company name on and to and put the card game name in game settings as before. Same scenario. Once it's uploaded to Apple, then you will not be able to change the bundle. Identify Okay, so further down we come on. As I mentioned earlier, based on the preferences inside the external tools here, I'm going to use ill to see pp because that someone kind of works best for me. That rather than using mono scroll down, we do. We need a camera usage description. Just Teoh prevent any problems, anything with a star. I'm just going to write something in at least a mute. Other audio source says out. It doesn't need to do that. Now this particular one is going to be for iPhone only Andi. The target STK is whether it's for a simulator or a device. Meaning, Do you want to test this inside X cold simulator? Or do you want to plug your phone into X code via USB on, then running on a device of this is up to you. I'm going to use a simulator. Andi, I'm going to set my minimum IOS version to be eight as well. Okay, Now If we're going to hit any problems, it's going to be with IOS. So let's give it a build and see what happens. I'll make sure it goes into the same place. Here we go. So what this is now going to do is export our game on bundling up, ready to be opened inside X code on. Then it's from X cold that you were actually push it to your device. So Apple works a little bit differently. As usual, they have their own rules. So once this is done, it should automatically open X clothes. And if you don't have it on, you guys not need to download it. So I'd recommend pausing the video because it's about four gig inside, so it's going to take a while to come down now while this is exporting, I'm going to jump into chrome again for a second on. I want to take you to the Apple Developer program. Okay, now this is because I move these guys out of the way again. No, it's exporting now. This is Apple's website Andi to be allowed to build for IOS. The software requires you to log into the Apple Developer program Now it's easy enough to lock to and roll you to simply click and roll on. Decide if you want to do it as a company or is an individual. The negative is that it's not an immediate activation. Andi. There's a fee involved as well. If you want to upload to the Google store, then all you have to do is go to the Google developer. Console a new register for a free account, and you can upload APS for Android completely for free in this Google developer area. Okay, but with Apple, it costs about $100 a year on it's an annual recurring fee on, and one thing to bear in mind is, if you stop paying the enrollment fee, Apple will actually remove all your APS from the APP store as well. So, like I said, they work a little bit differently than thing. Google. It's much easier, in my opinion, Teoh build for Android, but anyway, so this is still exporting. Once it's done, though, it will open in X coat on, Then hopefully run this on their on a simulator to show you the result. So a pause, a video I don't need to sit through this. Okay, guys, So good news. It's exported without any errors or anything on X cold has opened in the background. It's just index in the actual site now, now, Because when I exported it, I said that I wanted to use a simulator. Then I have the bunch off different devices up here in this drop down here. Now, if you don't see this, what you need to do is click on here, go across to the build settings and make sure that supported platforms is on IOS. Otherwise, the devices won't be there. If you chose to export it to a device, then you won't have this list here. You will be required to plug in your phone or iPad or whatever you want to use Andi. Then basically, your device should appear up top. Now I'm going to use an iPhone six. Andi, let's just have a quick glance just to make sure that everything's OK. Once I'm on this panel here, by the way, this is the page that you have to check a lot of it won't mean anything to you guys. Don't worry about that. Some of it doesn't mean anything to me, but let's have it. Just have a quick glance. Okay? Now I think everything's pretty much fine. I'm going to try and give it a run and start my application now, done the left inside. We have a little bit of debugging going off. Don't worry about the warnings. These air just depreciations, which there are always depreciations based on unity and ex cold have in different versions off the software. And if not being in complete sync. I only worry about it. Really, If we get a red error message instead. Okay, that's done. But before I jumped to the simulator for a second, I just want to point this out here. The Mac o link a warning, then that nine times out of 10 will be down to this library here. Okay, so that's the easiest way to fix it. The thing about Apple development, especially X code, you won't be alone. There are always people with problems using this this piece of kit. So if you google anything tha the warning message. Here we go. I might shut up for a second. I just turned the device around to the left. Here we go. OK, cool look. So here we are. Let's start the game. It will be a little bit sluggish on here because it's just a simulated. Will run a hell of a lot better on an actual device as a music way. Go. It's just lagging for May. But does the sound work for the horn? A. On coming quit does. It does work fine. It's just because, obviously, the terrain is a little bit too heavy on the memory side for the actual simulator. So anyway, guys, long story short, we have successfully exported our our game through to Steve I. So I always recommend testing it on the actual devices to really check the performance on. Then we can honor remove elements in the game to try and boost that performance and increase the frame rate. It's just that I didn't have my iPhone to hand today as speed repaired. Okay, anyway, guys, thanks so much for doing this course. I hope you now feel a little bit more comfortable using unity. It's just an introduction to learn the fundamentals off. How the actual software works on have a little bit of fun along the way. So what? I believe enjoyed it. If you feel it's worth a five star rating, feel free to leave me a cool rating on a little bit of feedback. I love hearing what people think on by maybe maybe even suggest a few things in the future if you want. Okay, so don't forget the Facebook group. If you want some additional support on, feel free to check out my other courses. If you like the way that I actually teach the A R courses are upset. Fantastic. Okay, brilliant, guys have fun on Dakota Way.