1 00:00:04,260 --> 00:00:05,400 ‫Welcome back. 2 00:00:05,430 --> 00:00:09,360 ‫In this chapter, we are going to create a zig zag clone. 3 00:00:09,390 --> 00:00:10,590 ‫You might know this game. 4 00:00:10,590 --> 00:00:19,410 ‫It's an infinite 3D runner where you simply run left and right and you collect crystals. 5 00:00:19,410 --> 00:00:21,840 ‫In this case, it's simple diamonds or crystals. 6 00:00:21,840 --> 00:00:27,510 ‫And we are going to build that game with a little high score with left and right, and we're going to 7 00:00:27,510 --> 00:00:30,420 ‫use a 3D animated player. 8 00:00:30,420 --> 00:00:36,270 ‫So in this case, it's just a little sphere that is walking left and right. 9 00:00:36,270 --> 00:00:41,130 ‫And we're going to use an asset from the asset store which has animations in them, and we're going 10 00:00:41,130 --> 00:00:42,390 ‫to look at all of that. 11 00:00:42,540 --> 00:00:44,490 ‫So let's get started. 12 00:00:44,520 --> 00:00:47,970 ‫Let's start with creating a new project. 13 00:00:47,970 --> 00:00:52,740 ‫So let's call this one Zig Zag clone. 14 00:00:53,910 --> 00:00:57,060 ‫It's a3d project, so let's create that one. 15 00:00:57,330 --> 00:00:58,260 ‫All right, there we are. 16 00:00:58,260 --> 00:00:59,550 ‫The project is ready. 17 00:00:59,700 --> 00:01:02,310 ‫Now I am using my layout again. 18 00:01:02,310 --> 00:01:04,560 ‫You can use the layout that you prefer. 19 00:01:04,560 --> 00:01:11,880 ‫So next what we need is to add assets from the asset store because we are going to use assets. 20 00:01:11,880 --> 00:01:21,840 ‫So let's go to the store and download the hand-painted stone texture and painted stone texture. 21 00:01:22,950 --> 00:01:24,990 ‫And that's just the one that I have chosen. 22 00:01:24,990 --> 00:01:25,590 ‫It's free. 23 00:01:25,590 --> 00:01:26,850 ‫It's a great texture. 24 00:01:26,850 --> 00:01:29,100 ‫You can choose a different texture if you prefer. 25 00:01:29,100 --> 00:01:30,750 ‫So, but this one is free. 26 00:01:30,750 --> 00:01:36,090 ‫And if it should not be available anymore, or if it's not free anymore, you can simply use any texture 27 00:01:36,090 --> 00:01:36,660 ‫that you like. 28 00:01:36,660 --> 00:01:39,870 ‫So just go ahead and search for a free texture that you prefer. 29 00:01:40,110 --> 00:01:44,880 ‫So let's go ahead and download that one and import it into our project. 30 00:01:45,030 --> 00:01:48,360 ‫As I have downloaded it already, I can simply import it. 31 00:01:48,360 --> 00:01:57,090 ‫So let's press import after you've downloaded it and import the whole package into your game. 32 00:01:58,410 --> 00:02:02,520 ‫That will take a little while and then it will add it to your assets. 33 00:02:02,640 --> 00:02:07,260 ‫It's done by load roly poly and they have done a great job here. 34 00:02:07,260 --> 00:02:10,290 ‫So let's go ahead and use that asset. 35 00:02:10,290 --> 00:02:17,400 ‫Let's go back to the scene and let's create a 3D object, which is a cube. 36 00:02:17,730 --> 00:02:19,800 ‫So let's go ahead and create a cube. 37 00:02:19,830 --> 00:02:22,050 ‫My camera is set to minus ten. 38 00:02:22,050 --> 00:02:25,050 ‫My cube is at 000. 39 00:02:25,050 --> 00:02:28,070 ‫And as you can see here, that's where the cube currently is. 40 00:02:28,080 --> 00:02:30,780 ‫Let's change the camera angle a little bit. 41 00:02:30,780 --> 00:02:35,010 ‫Let's go a little bit further to the front. 42 00:02:35,070 --> 00:02:36,510 ‫Yeah, that should be fine. 43 00:02:36,510 --> 00:02:40,320 ‫So now we have our little cube and it's just white and it doesn't look great. 44 00:02:40,320 --> 00:02:46,680 ‫But we can change that really quick by going into hand-painted stone texture, then material, and there 45 00:02:46,680 --> 00:02:48,390 ‫you'll find the stone floor. 46 00:02:48,390 --> 00:02:52,590 ‫So let's drag the stone floor into our little cube. 47 00:02:53,400 --> 00:02:55,980 ‫As you can see, our cube looks a lot better now. 48 00:02:55,980 --> 00:03:00,780 ‫So this is how our cube looks and it has a very nice touch. 49 00:03:00,780 --> 00:03:02,580 ‫I think I like this texture. 50 00:03:02,580 --> 00:03:04,590 ‫You can as I said, you can use a different one. 51 00:03:04,590 --> 00:03:07,680 ‫So now let's duplicate that one and drag it to the side. 52 00:03:07,680 --> 00:03:13,800 ‫So you can see here, that's how it could look like if you build a street or a road, and that's how 53 00:03:13,800 --> 00:03:14,490 ‫I'm going to call it. 54 00:03:14,490 --> 00:03:21,240 ‫So I'm going to create a new object, an empty object, which is going to be my folder or my parent 55 00:03:21,240 --> 00:03:23,820 ‫for all of my road pieces. 56 00:03:23,820 --> 00:03:29,550 ‫So let's call that one road and let's call the cube. 57 00:03:29,580 --> 00:03:31,200 ‫I'm going to delete that one again. 58 00:03:31,320 --> 00:03:34,140 ‫Let's call the Cube Road part. 59 00:03:34,140 --> 00:03:36,540 ‫So I'm going to rename it Road Part. 60 00:03:37,950 --> 00:03:41,520 ‫And before I drag it into my road, I make sure that road is reset. 61 00:03:41,520 --> 00:03:48,840 ‫So I'm going to reset road to 000 and now let's drag that road part into road. 62 00:03:50,470 --> 00:03:51,070 ‫All right. 63 00:03:51,070 --> 00:03:56,470 ‫So now all of the road parts will be within our road game object. 64 00:03:56,470 --> 00:04:01,420 ‫And while we're at it, let's go ahead and save that scene. 65 00:04:01,420 --> 00:04:09,670 ‫So let's save scene as and I'm going to call it Main, so let's save it as main. 66 00:04:12,160 --> 00:04:12,430 ‫All right. 67 00:04:12,430 --> 00:04:15,670 ‫That's just our road piece or road part. 68 00:04:15,670 --> 00:04:18,490 ‫And now we need to have a player. 69 00:04:18,490 --> 00:04:20,680 ‫And in zigzag, it's just a sphere. 70 00:04:20,680 --> 00:04:27,130 ‫So you could go ahead and create a sphere here, 3D object sphere, but that wouldn't teach you how 71 00:04:27,130 --> 00:04:28,420 ‫to do animations. 72 00:04:28,420 --> 00:04:31,870 ‫So let's have a look at an object that does animate. 73 00:04:31,870 --> 00:04:33,040 ‫Well, very well. 74 00:04:33,040 --> 00:04:39,250 ‫And that is an asset called character pack free sample. 75 00:04:40,960 --> 00:04:46,510 ‫Just search for that in the asset store and you will find this character Peg Free, which is a great 76 00:04:46,510 --> 00:04:49,360 ‫package which contains a 3D object. 77 00:04:49,360 --> 00:04:55,240 ‫So this guy here, it has the animation for running and some other animations and we're going to use 78 00:04:55,240 --> 00:04:55,930 ‫that guy. 79 00:04:56,140 --> 00:05:02,470 ‫So let's download it, import it, and in this case, I'm going to import the whole package. 80 00:05:02,470 --> 00:05:04,120 ‫So let's import all. 81 00:05:06,410 --> 00:05:12,290 ‫And as soon as that's done, we have the super sane character pack free sample, which is created by 82 00:05:12,290 --> 00:05:12,940 ‫Super Saint. 83 00:05:12,950 --> 00:05:14,510 ‫So thanks to that guy. 84 00:05:14,570 --> 00:05:19,160 ‫Now let's go ahead to the prefabs. 85 00:05:19,190 --> 00:05:21,410 ‫In prefabs, we have two folders. 86 00:05:21,410 --> 00:05:23,810 ‫One is called base and one is simple movement. 87 00:05:23,810 --> 00:05:27,260 ‫And I'm going to use simple movement and high quality. 88 00:05:27,260 --> 00:05:29,240 ‫You could go ahead and use the mobile one. 89 00:05:29,240 --> 00:05:33,620 ‫It will be slightly different in terms of quality, but I'm going to use the high quality now. 90 00:05:33,620 --> 00:05:40,910 ‫So let's take that mail three simple movement and drag that into our scene and to be precise, onto 91 00:05:40,910 --> 00:05:41,930 ‫our road. 92 00:05:42,440 --> 00:05:45,080 ‫So I'm going to just put that guy on top of it. 93 00:05:45,770 --> 00:05:53,300 ‫And now, as you can see, it has a simple character control, it has an animator, a capsule, collider, 94 00:05:53,300 --> 00:05:58,880 ‫rigid body, all of the components that are relevant when animating and moving a character. 95 00:05:59,300 --> 00:06:04,760 ‫So now we can have a look at what this guy looks in real time. 96 00:06:04,760 --> 00:06:06,110 ‫So let's start the game. 97 00:06:08,020 --> 00:06:11,320 ‫And as you can see, he's already animating here. 98 00:06:11,320 --> 00:06:13,000 ‫You can see it a little bit better. 99 00:06:13,150 --> 00:06:14,920 ‫So now let's move a little bit. 100 00:06:16,570 --> 00:06:17,930 ‫Well, and I fell off. 101 00:06:17,950 --> 00:06:18,370 ‫All right. 102 00:06:18,370 --> 00:06:19,630 ‫I was a bit too quick. 103 00:06:19,780 --> 00:06:24,760 ‫So let's go back and change the position a little bit. 104 00:06:25,030 --> 00:06:28,480 ‫So let's look at it from a slight angle. 105 00:06:28,480 --> 00:06:30,460 ‫And now let's go to the game. 106 00:06:30,460 --> 00:06:32,560 ‫And as you can see, we can turn left and right. 107 00:06:32,560 --> 00:06:35,020 ‫We can walk a little bit forward and backward. 108 00:06:35,110 --> 00:06:39,670 ‫And yeah, he already does animate quite well if I fall off the edge. 109 00:06:40,180 --> 00:06:41,710 ‫Let's go towards this side. 110 00:06:41,710 --> 00:06:43,470 ‫You can see how he falls. 111 00:06:44,950 --> 00:06:48,100 ‫So he does an animation for falling and that's great. 112 00:06:48,100 --> 00:06:51,390 ‫So he does quite some things already and he does too much. 113 00:06:51,400 --> 00:06:56,830 ‫This little asset is great if you want to make a game where you do all of these movements, but we're 114 00:06:56,830 --> 00:07:01,750 ‫just going to move left and right, so we will have to reduce some of the components of this player. 115 00:07:01,750 --> 00:07:05,170 ‫So we're going to have to change the script or even create our own script. 116 00:07:05,170 --> 00:07:08,260 ‫So yeah, we will look into animations. 117 00:07:08,260 --> 00:07:12,520 ‫We are going to look into movement of a 3D character and much more. 118 00:07:12,520 --> 00:07:19,420 ‫So get ready to see how to create a procedural map which will be infinite, where you can collect crystals 119 00:07:19,420 --> 00:07:25,090 ‫and where you where you can create an amazing and addictive game for your phone. 120 00:07:25,630 --> 00:07:30,880 ‫So see you in the next video where we're going to go ahead and set the right perspective.