0
\$\begingroup\$

I am working on a 2D game and I have created a simple sprite sheet. The sprite sheet represents a medkit. The size of the sprite sheet is 128x16 pixels with 8 different frames that animate the medkit bobbing up and down.

I have imported the sprite sheet into Unity as a Sprite with Sprite Mode set to multiple, Generate Mip Maps unchecked, Filter Mode set to Point, and Format set to Truecolor. I have sliced the sprite sheet using the Unity Sprite Editor and added the animation to my scene.

After doing so, I am able to see my sprite in my game. However I noticed that the animation of the sprite did not correspond to the sprite sheet. Some pixels seem to be distorted and tearing. I have searched online and couldn't find anyone with the issue I had. As you can see from the gif below, the top of the sprite is tearing.

Does anyone know what is causing this issue?

Gif of the issue:here

Sprite sheet used: enter image description here

\$\endgroup\$
4
  • \$\begingroup\$ This might be related to this artifact that arises when the ratio of source texels to screen pixels is not a whole number — can you tell us more about your camera size, pixels to world units setting on the sprite, and display resolution? \$\endgroup\$
    – DMGregory
    Apr 11, 2016 at 12:49
  • \$\begingroup\$ I'd recommend to create animation rather than using sprite sheet for this simple purpose \$\endgroup\$ Apr 11, 2016 at 13:41
  • \$\begingroup\$ Is your camera pixel perfect? \$\endgroup\$
    – Exerion
    Apr 11, 2016 at 14:08
  • \$\begingroup\$ @DMGregory Thank you for that link, that was another problem I was having and I'll have to read up on that. \$\endgroup\$ Apr 12, 2016 at 0:23

1 Answer 1

0
\$\begingroup\$

Well, I don't know why you get this tearing. Perhaps the spritesheet itself is too small and unity is messing up. I suggest you try two things to solve your problem. 1. Up the resolution of the sprite and see if that solves the problem 2. If the animation is bobbing up and down you dont need a frame by frame animation. Just animate the transform component of the gameObject and you will get the same effect.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you for the suggestion, The problem comes and goes so I will have to look into this further. \$\endgroup\$ Apr 12, 2016 at 0:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .