Monday, November 28, 2022
HomeSoftware EngineeringWorking with Sprite Sheets in Unity | by Joseph Maurer | Geek...

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

Sprites are a significant a part of engaged on a recreation 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 via a fundamental instance of how one can cut up a sprite and hook it as much as an animation 2D platform recreation! Let’s get began!

To begin you will want to accumulate a sprite sheet from someplace. Here’s a hyperlink to the place I acquired the platform character for this challenge.

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

As soon as completed, you will notice a light-weight 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 accomplished when you may increase the sheet and see every picture appended. One thing like this:

At this level, you can begin making your animations to 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 straightforward to inform your participant how one can transfer!

And then you definitely’re accomplished! You now have a straightforward technique to management your participant in code with the intention to make a cool recreation!



Please enter your comment!
Please enter your name here

Most Popular

Recent Comments