Search Unity

Sprite with blurred edges

Discussion in '2D' started by kaysery, Oct 9, 2018.

  1. kaysery

    kaysery

    Joined:
    Mar 25, 2015
    Posts:
    6
    Hi, i have a little problem with my character movement in unity, actually when it's move the edges become a little blurred for the movement:

    this is a video with movement:



    and this is a video without movement:



    as you can see when the sprite is not moving the image it's fine but when i apply some movement the edges become blurred.

    there is the code for the movement:

    Code (CSharp):
    1.  
    2. public class RocketScript : MonoBehaviour
    3. {
    4.  
    5.     public float speed = 1f;
    6.     Rigidbody2D rb;
    7.     Animator anim;
    8.     int direction = 1;
    9.  
    10.  
    11.     private void Start()
    12.     {
    13.         print(Application.targetFrameRate);
    14.         Application.targetFrameRate = 100;
    15.         //print(Application.targetFrameRate);
    16.         //transform.Rotate(0, 0, 30);
    17.         rb = GetComponent<Rigidbody2D>();
    18.         anim = GetComponent<Animator>();
    19.     }
    20.  
    21.     // Update is called once per frame
    22.     void Update()
    23.     {
    24.             if(Input.GetTouch(0).phase == TouchPhase.Began)
    25.         {
    26.          
    27.             anim.SetInteger("direction", direction);
    28.             direction = direction * -1;
    29.         }
    30.     }
    31.  
    32.      void FixedUpdate()
    33.     {
    34.  
    35.  
    36.         rb.position = new Vector3(0, 0, 0);
    37.  
    38.         if (direction < 0)
    39.         {
    40.             rb.AddForce(new Vector2(200f,0));
    41.         }
    42.         else
    43.         {
    44.             rb.AddForce(Vector2.left * speed);
    45.         }
    46.     }
    47. }
    Help me please,Thanks in advanced.
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    If you pause the video, you can see there is no blur. The problem is your screen; you're seeing ghosting caused by slow pixel response time. To fix it, get a screen with a faster pixel response time. You can disguise the issue somewhat by using less-contrasting colors. Red and cyan are exact opposites, which makes the problem worse since every pixel element has to change to the opposite value.

    --Eric
     
  3. kaysery

    kaysery

    Joined:
    Mar 25, 2015
    Posts:
    6
    Hi @Eric5h5 ,As you said i tried change the color of the background, but the ghosting problem still happen, one thing i forgot to say is that in using this game in an android cellphone
     
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You'd have to get a phone with a better screen then. Unity can't fix hardware deficiencies.

    --Eric