Hello, guys.
In this video, I want to talk about sprites and how to prepare them, because now you have assets that
I prepared for you.
But still, I want to let you know how to do that on your own in case you have your own sprites in your
own project.
All right.
So in the moment, you can see that my sprites are all set, and if you drag them to the project, they
are like this.
But if you take any of those sprites, let's say I'll take idle number two and I'll click reset over
here.
Then there's going to be default settings, How it would behave if you just transferred to a project
from somewhere and if you drag it here, it is very small, right?
First we need to make it bigger on that.
We're going to change pixel per unit, so let's change that because the lower it is, the bigger sprite
will be and it's going to be 16 here just like that.
Now we have the sprite, but it is not sharp, it is not crispy like the one we have over here.
You can see the difference between them, right?
So what to do here is we need to change filter mode to point no filter and compression should be none
hit.
Apply.
And now it is how it should be.
Perfect.
Something else to mention here.
Look, I have my objects, and my center point of this object is above his head.
If you select the platform, you can see it is in the middle, right?
And for the player, it is in the middle.
But for this one, it is above his head.
Why is that?
First, we need to make sure.
Over here in the corner.
Center changed to pivot because this using center of the object, this using pivot point, if it has
one.
So let's say this is center point.
And now if I select the player, I can see it is above as well.
This happens because of the how sprite was drawn at first.
Look at this one if I go to Sprite editor.
I can see that my center is over here.
And all of that above is just empty space.
But still it's part of the picture.
So that's why my center is here.
What we can do to fix it, to make it normal because it's a good, healthy practice to have your pivot
point and the center of the object.
When you change position in unity, it is very important.
So first, what you can do is go over here and select pivot, and then you need to make sure your pivot
point is in the center.
In this case, we need to do it manually.
In some other projects.
It is already in the center.
It all depends on the sprites and assets and who made them at first place.
Like if we check sprites in my in other project from another course on how to make platformer, we can
see that Sprite is in the center.
And even if I reset the settings, give me a second.
I'll take this idle and reset.
Yeah, we can see it is in the center.
If I change it to, I'll do it quickly.
Multiple and 16.
Sprite ed I play and I slice it green by cell size.
What is that?
I don't remember.
Two.
I started to slice.
Yeah, if I slice them 32 by 32, we can see that each of them has a pivot point in the center and this
is what it should be.
This is the healthy practice, I would say.
Right.
So back here, we need to make it at the center.
How we can do that First, we can just change pivot point to something like Bottom Center, but it makes
it at the very bottom.
So we need kind of a custom pivot point, right?
So for that, we can go over here and change custom.
Now this can be dragged sorry, these can be dropped to change pivot point, and it should be somewhere
in the center.
It's not so easy to find one with each spread.
It's different.
So probably you'll have to spend some time on it.
But I know the number because I did it before.
So it's point five on the x and .53 500.
Why?
I guess.
Nah.
No, wait.
Oh, sorry.
2.5.
Yeah, My bad.
It's.
2253, five on the Y, and then it will be fine.
It will be in the middle.
Now you know how to set pivot point and how to make your sprites crispy and fix the size of this price.
Something else here is important.
How to slice them.
As you can see, these sprites even in the same animation idle.
They are all set as a different file, so I don't need to cut them.
But as you just seen in my another project, and I'll use this one just to explain the point.
All right.
They are all together like that.
So for that, you should to go to Sprite mode over here and make sure it's multiple.
Well, let me reset it so you make sure it's multiple.
And then you go to Sprite editor, you hit apply and you have it here.
Now we need to slice it and it can have different way of slicing.
The best one is grid by cell size because it has proper size, but we don't know what kind of spreadsheet
you might have can be such a mess.
You need to do it manually.
All right.
So I choose 32 by 32.
And slice hit the play and have it here sliced all the way we need.
I'll change this back so later.
I won't forget to play.
And I don't need this project anymore.
Done.
Save.
So now you know how to set up sprites, how to cut them, how to prepare them, and if there will be
something else important regarding sprites or in general, be sure I'll let you know in the future videos
because this is my second time recording this course.
I'm doing update, as you might know.
So it's all set.
No worries.
See you later.