Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
2
Question by rensjan2122 · Dec 16, 2014 at 10:26 AM · camera2dmovinglines

flickering lines when moving camera(unity 2d)

when i'm trying to move my camera these lines start to appear, my sprites are 32*32 and pixels per units is set to 32(so 1sprite=1unit)

schermafbeelding 2014-12-15 om 22.12.18.png (9.7 kB)
schermafbeelding 2014-12-15 om 22.12.33.png (10.2 kB)
Comment
Add comment · Show 5
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 MrSoad · Dec 16, 2014 at 05:05 PM 0
Share

Are you moving the landscape sprites?

Are you moving the camera in LateUpdate() ? You should if you are not.

Do all your Sprites(brown block, green block etc) come from one single image(sheet)? If so is there any space between them on this image?

avatar image Dave-Carlile · Dec 16, 2014 at 05:12 PM 0
Share

Does it happen when you do a full build and run standalone? I have this problem running in the editor, but it goes away in a build.

avatar image MakinStuffLookGood · Dec 16, 2014 at 07:02 PM 0
Share

Looks like it's just subpixel movement/ floating point error causing those lines. Even if your sprites are 1 world unit in size and you place them on a grid perfectly spaced 1 unit apart in x or y, you can still end up with these small errors.

avatar image rensjan2122 · Dec 17, 2014 at 01:05 PM 0
Share

i just tested standalone and it seems to be fixed, tnx Dave

avatar image rensjan2122 · Dec 17, 2014 at 01:23 PM 0
Share

i just tested it some more and i now get this alt text

schermafbeelding 2014-12-17 om 14.22.03.png (25.0 kB)

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Dave-Carlile · Dec 17, 2014 at 01:38 PM

Create a new material, set the shader to Sprites/Default, and check the Pixel Snap box. Use that material for your sprites.

If you want to be completely pixel perfect, where each pixel on your sprite always matches up perfectly with a pixel on the screen, you'll need to do some more work...

http://indiehoodgames.wordpress.com/2013/07/27/pixel-perfect-calculator-for-orthographic-camera-unity3d/

copied from the link in case it ever goes dead - Camera Size is Orthographic Size

 Camera Size = x / ((( x / y ) * 2 ) * s )

 Where:
 x = Screen Width (px)
 y = Screen Height (px)
 s = Desired Height of Photoshop Square (px)




If you allow zooming and such by changing the orthographic size... well, I haven't figure out how to do that perfectly yet - I believe it involves only allowing certain multiples of orthographic size - probably powers of 2.

Comment
Add comment · Show 1 · 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
avatar image rensjan2122 · Dec 17, 2014 at 10:23 PM 0
Share

tnx you just saved my life

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

6 People are following this question.

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

Related Questions

Fade between two moving cameras 1 Answer

camera follow problem-unity 4.3 2d 1 Answer

2D Camera Smooth follow, FixedUpdate and LateUpdate odd difference, help needed. 1 Answer

Camera movement in a 2D? (like angry birds) 1 Answer

Keeping two objects in frame 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