Software Engineering

Working with Sprite Sheets in Unity | by Joseph Maurer | Geek Tradition

Working with Sprite Sheets in Unity | by Joseph Maurer | Geek Tradition
Written by admin


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 comprises a number of photos inside it. I’m going to spend a while going by a primary instance of break up a sprite and hook it as much as an animation 2D platform sport! Let’s get began!

To start out you’re going to want to accumulate a sprite sheet from someplace. Here’s a hyperlink to the place I acquired the platform character for this venture.

As soon as imported into Unity, you’re going to must splice the sprite. You are able to do this in a lot of methods, however I counsel beginning by seeing if Unity can mechanically work out every of the pictures. To do that, use computerized mode as pictured beneath.

As soon as completed, you will note a lightweight gray field round every of the pictures 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 finished when you possibly can 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 primary instance, this simply concerned swapping the sprites on every doable state to be the right picture.

Professional tip: Expose plenty of variables inside your Animator in order that it’s simple to inform your participant transfer!

And you then’re finished! You now have a straightforward approach to management your participant in code so that you could make a cool sport!

About the author

admin

Leave a Comment