Search Unity

Unity 2D Jittery Camera as it moves at a constant speed

Discussion in '2D' started by dyuldashev, May 2, 2017.

  1. dyuldashev

    dyuldashev

    Joined:
    Mar 3, 2016
    Posts:
    76
    I never thought I would encounter this issue, but, now, I know that it's a problem innate to Unity 2D. Let me describe the problem. I have a simple Camera. And I instantiate around 10-20 small elliptical objects. Then, I move my Camera horizontally at a constant speed. Sometimes, it jitters when I move fast, sometimes it jitters when I move slow. In other words, the Camera is shaking as I can see that in the Scene mode. I cannot seem to get any solution. I tried lerping, changing the position manually, smooth damping, interpolations, PPU and Sprite import settings, setting VSync.count to 0, lowering the quality, even buffering Physics updates and reading the values in the Update() function. However, the Camera is still shaky, and I don't really know what else can be done here. The worst part is that sometimes it is so smooth, and at other times, it jitters like every millisecond. I am attaching a simple Unity 2D project that describes my problem (has a drop down menu in my Camera Script for Lerping, Smooth Damping, and Changing the position) so you can see what I am talking about: https://www.dropbox.com/s/n015rlzxv7g0ahm/JitteryCameraMovement.zip?dl=0
    I have tried almost everything and read almost all Unity 3D forum threads, but I have not really found any solution. I strongly believe it's a Unity bug as I, a Unity 3D developer, should be able to move the Camera without jitters. So, if anyone has been through this, please, help me as I have been struggling with it for days with no luck. Thanks.
     
  2. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    Your position one is working pretty decently for me. Your lerp is kind of okay (I think your lerp isn't setup properly) but I'm not sure what you're seeing compared to me. Beyond that, sorry no help.
     
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,411
    theANMATOR2b likes this.