Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Shaking objects

Discussion in 'Scripting' started by PhyresiCompany, Jun 18, 2022.

  1. PhyresiCompany

    PhyresiCompany

    Joined:
    Oct 12, 2021
    Posts:
    3
    If I am far from the starting point of the map and moving or rotating my object starts to shake. The further I move away, the more he shakes

    This issue has nothing to do with scripts, collision or physics, I removed all components except camera and mesh objects


     
  2. TheDevloper

    TheDevloper

    Joined:
    Apr 30, 2019
    Posts:
    69
    are you using time.deltatime or fixed delta time ???
    this might be the issue
     
  3. chubshobe

    chubshobe

    Joined:
    Jun 20, 2015
    Posts:
    52
    That's how it is in many games and game engines when numbers get too large there's imprecision which visually looks like shaking.
     
  4. itisMarcii_

    itisMarcii_

    Joined:
    Apr 5, 2022
    Posts:
    107
  5. PhyresiCompany

    PhyresiCompany

    Joined:
    Oct 12, 2021
    Posts:
    3
    There's no script, I moved by the inspector
     
  6. PhyresiCompany

    PhyresiCompany

    Joined:
    Oct 12, 2021
    Posts:
    3
  7. itisMarcii_

    itisMarcii_

    Joined:
    Apr 5, 2022
    Posts:
    107
    I am not 100% sure about that, but changing values inside the Inspector are updated inside the Update method.
    But your camera movement should be executed inside the LateUpdate methode after all Update logic is finished. The reason is that we want to render the scene after everything stopped moving. Thats why its jittering, because the other values are still changing after your camera moved to its destination.

    Try, instead moving by inspector, using a script. You could use a simple script which allows you to control your camera by your cursor. There should be enough videos about that.
     
    TheDevloper likes this.