3
\$\begingroup\$

I'm working on a 2D game in Unity. My triangle sprites display in-game with a line along one of the transparent sides:

screenshot

Larger view here.

You might need to zoom somewhat. It's quite obvious on the leftmost triangle.

I'm unsure where this comes from. There is no border in the PNG file. As you can see in the screenshot, the border is also present in the preview.

Where does it come from? How do I get rid of it?

\$\endgroup\$
2
  • \$\begingroup\$ Are you sourcing all three sprites from the same PNG texture? If so, you might need a few pixels of padding between the images. \$\endgroup\$ – rutter Aug 8 '14 at 21:17
  • \$\begingroup\$ @rutter nope, they're seperate files \$\endgroup\$ – Serris Aug 8 '14 at 21:41
0
\$\begingroup\$

I've opened the sprite from my Assets folder into photoshop. there was no border. I cut away the offending borders (which made my sprite into a 69x69 instead of 70x70).

this seems to have solved it for now.

if anyone has a similar issue and finds a better solution, please do post.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Try changing the compression size of the image \$\endgroup\$ – Savlon Aug 8 '14 at 22:52
0
\$\begingroup\$

This looks like texture wrapping.

Click on the texture, open the texture inspector, and set Wrap Mode to Clamp.

\$\endgroup\$
1
  • \$\begingroup\$ The triangle is a sprite. when I changed the type to texture, it did say "clamp" under wrap mode, but I'm unsure if that matters when i change the type back to sprite \$\endgroup\$ – Serris Aug 9 '14 at 11:43
0
\$\begingroup\$

I had the same problem. I've made some experiments with different types of sprites (single and maps). I've tried to add transparent border to my sprite map in Photoshop, but it didn't work. Then I separated the sprites from my sprite map. It worked for me. It seems that the problem is with sprite maps.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.