Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by SecretAgentMango · Dec 20, 2017 at 06:33 PM · 2dspritesmaplinesanti-aliasing

Pixel snap and anti-aliasing not working?

So I've been having an issue with lines in between my tiles in my 2D game. The go-to fix is usually to turn off anti-aliasing in project settings and turn on pixel snap on everything, but somehow pixel snap has made the lines more pronounced then they were before. Anyone else had this problem?

alt text

This (above) is what the game looks like with pixel snap on; the lines are permanent when my character walks. Without pixel snap, the lines just flash in and out.

pixelsnap.png (289.9 kB)
Comment
Add comment · Show 7
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Larry-Dietz · Dec 20, 2017 at 06:47 PM 0
Share

Probably a stupid question, but are you sure your tile image doesn't have a line of missing pixels at the bottom? The only breaks in the line appear to be from possibly a slightly taller tile below.

Just a thought, -Larry

avatar image SecretAgentMango Larry-Dietz · Dec 20, 2017 at 06:54 PM 0
Share

I don't think so, because when I have pixel-snap off the lines only appear intermittently. Here's a snapshot of a frame that's fine when pixel snap is off: alt text

nopixelsnap.png (243.5 kB)
avatar image Larry-Dietz SecretAgentMango · Dec 20, 2017 at 06:58 PM 0
Share

I would take a look up close at the tile images just to be sure. with pixel snap off, it may be allowing more overlap, hiding the line.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by SamFZGames · Jan 14, 2018 at 03:17 PM

Hi there, sorry it took a while to get an answer for this one, I just found this, but if you didn't already work it out I can sort this one out for you.

When scaling sprites to particular resolutions, sometimes Unity uses a little bit of whatever's around the edge of the sprite in your texture when scaling up (something to do with the resolution not being an integer multiple of your sprite's resolution), so what you're seeing there is either a piece of the tile you have stored above it in your tile sheet, or transparency. Seems like the former when you look at how above your trees there's a brown line and it's black above everywhere else.

The solution is to separate your tiles from one another, have a gap between each tile of 2 pixels or so, and add some 'bleed' (padding) to the edge of each tile. For example you'd want to put a 1 pixel border of green around your grass tiles, or if the tile is complex then just copy the edge pixels. Then Unity will fill that tiny pixel gap with that colour, and it will be unnoticeable.

alt text

^ Here's an example with some tiles of mine. The blue line shows where Unity slices them. I have 1px extra pixels around the edge of every tile. Do this and Unity will stop giving you those lines.

Super Tilemap Editor on the asset store comes with an atlas editor feature that can do this for you in a couple of clicks.


screen-shot-2018-01-14-at-151219.png (95.7 kB)
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

142 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Lines at the top of sprites 3 Answers

How to get better sprite quality without turning on anti-aliasing? 0 Answers

Dynamic Interactive 2d World Map 0 Answers

Crop/Mask a Sprite on runtime 0 Answers

Render sprite on sprite ignoring alpha? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges