Wednesday, February 8, 2023
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 accommodates a number of pictures inside it. I’m going to spend a while going by way of a fundamental instance of how you can cut up a sprite and hook it as much as an animation 2D platform recreation! Let’s get began!

To start out you will want to accumulate 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 will must splice the sprite. You are able to do this in quite a lot of methods, however I counsel beginning by seeing if Unity can routinely determine every of the pictures. To do that, use automated mode as pictured under.

As soon as completed, you will notice a light-weight 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 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 doable state to be the proper picture.

Professional tip: Expose a number of variables inside your Animator in order that it’s simple to inform your participant how you can transfer!

And then you definately’re finished! You now have a straightforward option to management your participant in code with the intention to make a cool recreation!



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments