Search Unity

Background image pixel "vibration" on movement?

Discussion in '2D' started by donbaloo, Apr 24, 2017.

  1. donbaloo

    donbaloo

    Joined:
    Apr 24, 2017
    Posts:
    3
    Hey folks, I'm sure this is embarrassingly simple but I can't figure out how to fix this and I've sunk too many hours into to hold off asking any longer. I'm just a beginner (have put in probably 50 hours of tutorials though!) and still trying to get the hang of basics really. Anyway, right now I'm just trying to simply move a sprite based icon over a background map image. And it works. The problem though is that as the camera moves with icon, the background map starts to get pixel vibration. I don't know how else to describe it. Its not TERRIBLE but its annoying. Its least noticeable if moving along the Y axis only, a little more noticeable on X only, and very noticeable on the diagonal.

    I have the camera childed to the icon and the icon moves in Update (based on mouseclick) with:

    Code (CSharp):
    1. transform.position = Vector3.MoveTowards (transform.position, target, speed * Time.deltaTime);
    I've seen a few other mentions of this problem but not enough or in depth for me to figure out a solution. Thanks for your time.
     
  2. der_r

    der_r

    Joined:
    Mar 30, 2014
    Posts:
    259
    Do you have any code running that tries to make the game pixel perfect? Like rounding the positions, etc?
     
  3. donbaloo

    donbaloo

    Joined:
    Apr 24, 2017
    Posts:
    3
    I do not. Should I focus my search in that direction?
     
  4. der_r

    der_r

    Joined:
    Mar 30, 2014
    Posts:
    259
    No it was just a guess because I had a similar effect recently. :D Could you post a GIF of what it looks like? And more of your code would be helpful.