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 Lost_Syndicate · Aug 18, 2018 at 08:27 AM · cameragraphicspixel art

Camera / Graphic bug with 2D Sprites [Please help me solve this]

There's a bug in my game i cannot figure out how to solve. It looks like a graphic bug and i don't know how to fix it, i tried changing Anti-aliasing off, and all of that, still doesn't work. I assume its the camera now, but i want help. The code and images plus a video are below.alt textalt text I don't understand it, you can see the graphic settings, and the pixel tearing. Somehow the grass doesn't do it, but the dirt does. So far it's layer, because I'm using unity's Tile map system. Here's the video. https://www.youtube.com/watch?v=_Xo7Re-ltz8 and here's the code:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 public class Camera_Controller : MonoBehaviour {
 
     public float moveSpeed;
     public GameObject camTarget;
     private Vector3 Targetpos;
 
     private static bool exists;
 
     public BoxCollider2D bounds;
     private Vector3 minBounds;
     private Vector3 maxBounds;
 
     private Camera cam;
     private float halfWidth;
     private float halfHeight;
 
     private void Start()
     {
         DontDestroyOnLoad(transform.gameObject);
         
         if (!exists)
         {
             exists = true;
             DontDestroyOnLoad(transform.gameObject);
         }
         else
         {
             Destroy(gameObject);
         }
 
         moveSpeed = 5f;
 
         camTarget = GameObject.FindGameObjectWithTag("Player");
         cam = gameObject.GetComponent<Camera>();
         bounds = GameObject.FindGameObjectWithTag("WorldBounderies").GetComponent<BoxCollider2D>();
 
         minBounds = bounds.bounds.min;
         maxBounds = bounds.bounds.max;
 
         halfHeight = cam.orthographicSize;
         halfWidth = halfHeight * Screen.width / Screen.height;
     }
 
     private void Update()
     {
 
        if (camTarget == null)
         {
             camTarget = GameObject.FindGameObjectWithTag("Player");
         }
         if (bounds == null)
         {
             bounds = GameObject.FindGameObjectWithTag("WorldBounderies").GetComponent<BoxCollider2D>();
         }
 
         Targetpos = new Vector3(camTarget.transform.position.x, camTarget.transform.position.y, 0f);
         transform.position = Vector3.Lerp(transform.position, Targetpos, moveSpeed * Time.deltaTime);
         
         float clampX = Mathf.Clamp(transform.position.x, minBounds.x + halfWidth, maxBounds.x - halfWidth);
         float clampY = Mathf.Clamp(transform.position.y, minBounds.y + halfHeight, maxBounds.y - halfHeight);
         transform.position = new Vector3(clampX, clampY, transform.position.z);
     }
 
     public void SetBounds(BoxCollider2D newBounds)
     {
         bounds = newBounds;
 
         minBounds = bounds.bounds.min;
         maxBounds = bounds.bounds.max;
     }
 }
 


evidence1.png (210.5 kB)
evidence3.png (24.3 kB)
Comment
Add comment
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

4 Replies

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

Answer by eses · Aug 30, 2018 at 07:20 AM

Hi @memeinaction

For starters, take maybe four tiles (with biggest difference in their color palette), then add 2-8 pixels of padding around each tile graphic.

Then import these to Unity, create a temporary test map out of them.

Then see if you still get color bleed.

It's most likely from neighbor tiles in (texture)map / source image itself, but there might be other reasons for this too.

Here is one tutorial explaining the basic reason: https://youtu.be/QW53YIjhQsA

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
avatar image
0

Answer by Runalotski · Aug 18, 2018 at 02:00 PM

Hi,

On the png file for your dirt texture. If you click on that you should get import settings.

Try setting the following.

Bit maps: off Filter Mode: Point

Could you also send a screen shot of these settings?

Comment
Add comment · Show 9 · 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 Lost_Syndicate · Aug 20, 2018 at 10:39 AM 0
Share

yeah, sorry for the response, i can take a screenshot of my settings. Although i do have bit maps off and Filter $$anonymous$$ode to point, doesn't do anything.

avatar image Lost_Syndicate · Aug 20, 2018 at 10:47 AM 0
Share

alt text

capture.png (33.6 kB)
avatar image Runalotski Lost_Syndicate · Aug 20, 2018 at 08:58 PM 0
Share

What did you export this picture as?

If you have any compression the green pixels next to the dirt may bleed into it perhaps? If you use GI$$anonymous$$P there is an option that you can set to 0 and then set no compression on in unity.

avatar image Lost_Syndicate Runalotski · Aug 21, 2018 at 05:16 AM 0
Share

.png i think it was on Nearest Neighbor on photoshop exporting

Show more comments
avatar image
0

Answer by Robotic_Soul · Aug 29, 2018 at 07:36 AM

I don't have a solution for you, but I can help you understand how to debug this issue a bit. Try to create a scene file which has the minimum number of things loaded needed to reproduce the error. This can help give you insight, and better make your case for bugs. It can also give you a safe place to explore the issue. You need to be able to change things without being afraid you'll mess up your game. Good Luck

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 eses · Aug 29, 2018 at 01:27 PM 0
Share

@Robotic_Soul - a comment - isn't your answer more like a comment too?

avatar image
0

Answer by sushillakra21 · Aug 29, 2018 at 08:29 AM

I am not sure but I saw something like this when I was creating a endless runner and repeated same image, because both images were joined very closely I could see gaps, I overlapped those images. Just trying to help may not be relevant.

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 eses · Aug 29, 2018 at 01:28 PM 0
Share

@sushillakra21 - isn't this more like a comment too?

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

163 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 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

How to maintain sharp lines (pixel-like effect) from small textures on 3D assets 2 Answers

Render a camera multiple times in a single frame? 1 Answer

Scissor test/early rejection 2 Answers

Pixel art is jittery while moving camera. 2 Answers

Render Single Camera to Two Displays 0 Answers


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