Sprites are an important a part of engaged on a sport in Unity. A part of that’s how do you go about slicing a sprite that accommodates a number of photos inside it. I’m going to spend a while going by means of a fundamental instance of learn how to cut up a sprite and hook it as much as an animation 2D platform sport! Let’s get began!
To begin you’re going to want to amass a sprite sheet from someplace. Here’s a hyperlink to the place I acquired the platform character for this undertaking.
As soon as imported into Unity, you’re going to have to splice the sprite. You are able to do this in various methods, however I recommend beginning by seeing if Unity can robotically determine every of the photographs. To do that, use automated mode as pictured under.
As soon as completed, you will note a lightweight gray field round every of the photographs within the sheet. Hit Apply and let Unity work the magic behind the scenes to chop every picture right into a usable asset. You’ll know it’s carried out when you’ll be able to increase the sheet and see every picture appended. One thing like this:
At this level, you can begin making your animations on your character. In my fundamental instance, this simply concerned swapping the sprites on every attainable state to be the right picture.
Professional tip: Expose numerous variables inside your Animator in order that it’s simple to inform your participant learn how to transfer!
And then you definitely’re carried out! You now have a straightforward approach to management your participant in code as a way to make a cool sport!