Welcome back.
In this chapter, we are going to create a zig zag clone.
You might know this game.
It's an infinite 3D runner where you simply run left and right and you collect crystals.
In this case, it's simple diamonds or crystals.
And we are going to build that game with a little high score with left and right, and we're going to
use a 3D animated player.
So in this case, it's just a little sphere that is walking left and right.
And we're going to use an asset from the asset store which has animations in them, and we're going
to look at all of that.
So let's get started.
Let's start with creating a new project.
So let's call this one Zig Zag clone.
It's a3d project, so let's create that one.
All right, there we are.
The project is ready.
Now I am using my layout again.
You can use the layout that you prefer.
So next what we need is to add assets from the asset store because we are going to use assets.
So let's go to the store and download the hand-painted stone texture and painted stone texture.
And that's just the one that I have chosen.
It's free.
It's a great texture.
You can choose a different texture if you prefer.
So, but this one is free.
And if it should not be available anymore, or if it's not free anymore, you can simply use any texture
that you like.
So just go ahead and search for a free texture that you prefer.
So let's go ahead and download that one and import it into our project.
As I have downloaded it already, I can simply import it.
So let's press import after you've downloaded it and import the whole package into your game.
That will take a little while and then it will add it to your assets.
It's done by load roly poly and they have done a great job here.
So let's go ahead and use that asset.
Let's go back to the scene and let's create a 3D object, which is a cube.
So let's go ahead and create a cube.
My camera is set to minus ten.
My cube is at 000.
And as you can see here, that's where the cube currently is.
Let's change the camera angle a little bit.
Let's go a little bit further to the front.
Yeah, that should be fine.
So now we have our little cube and it's just white and it doesn't look great.
But we can change that really quick by going into hand-painted stone texture, then material, and there
you'll find the stone floor.
So let's drag the stone floor into our little cube.
As you can see, our cube looks a lot better now.
So this is how our cube looks and it has a very nice touch.
I think I like this texture.
You can as I said, you can use a different one.
So now let's duplicate that one and drag it to the side.
So you can see here, that's how it could look like if you build a street or a road, and that's how
I'm going to call it.
So I'm going to create a new object, an empty object, which is going to be my folder or my parent
for all of my road pieces.
So let's call that one road and let's call the cube.
I'm going to delete that one again.
Let's call the Cube Road part.
So I'm going to rename it Road Part.
And before I drag it into my road, I make sure that road is reset.
So I'm going to reset road to 000 and now let's drag that road part into road.
All right.
So now all of the road parts will be within our road game object.
And while we're at it, let's go ahead and save that scene.
So let's save scene as and I'm going to call it Main, so let's save it as main.
All right.
That's just our road piece or road part.
And now we need to have a player.
And in zigzag, it's just a sphere.
So you could go ahead and create a sphere here, 3D object sphere, but that wouldn't teach you how
to do animations.
So let's have a look at an object that does animate.
Well, very well.
And that is an asset called character pack free sample.
Just search for that in the asset store and you will find this character Peg Free, which is a great
package which contains a 3D object.
So this guy here, it has the animation for running and some other animations and we're going to use
that guy.
So let's download it, import it, and in this case, I'm going to import the whole package.
So let's import all.
And as soon as that's done, we have the super sane character pack free sample, which is created by
Super Saint.
So thanks to that guy.
Now let's go ahead to the prefabs.
In prefabs, we have two folders.
One is called base and one is simple movement.
And I'm going to use simple movement and high quality.
You could go ahead and use the mobile one.
It will be slightly different in terms of quality, but I'm going to use the high quality now.
So let's take that mail three simple movement and drag that into our scene and to be precise, onto
our road.
So I'm going to just put that guy on top of it.
And now, as you can see, it has a simple character control, it has an animator, a capsule, collider,
rigid body, all of the components that are relevant when animating and moving a character.
So now we can have a look at what this guy looks in real time.
So let's start the game.
And as you can see, he's already animating here.
You can see it a little bit better.
So now let's move a little bit.
Well, and I fell off.
All right.
I was a bit too quick.
So let's go back and change the position a little bit.
So let's look at it from a slight angle.
And now let's go to the game.
And as you can see, we can turn left and right.
We can walk a little bit forward and backward.
And yeah, he already does animate quite well if I fall off the edge.
Let's go towards this side.
You can see how he falls.
So he does an animation for falling and that's great.
So he does quite some things already and he does too much.
This little asset is great if you want to make a game where you do all of these movements, but we're
just going to move left and right, so we will have to reduce some of the components of this player.
So we're going to have to change the script or even create our own script.
So yeah, we will look into animations.
We are going to look into movement of a 3D character and much more.
So get ready to see how to create a procedural map which will be infinite, where you can collect crystals
and where you where you can create an amazing and addictive game for your phone.
So see you in the next video where we're going to go ahead and set the right perspective.