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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Sprites shake when move.

Discussion in '2D' started by Alexbg, May 11, 2015.

  1. Alexbg

    Alexbg

    Joined:
    Mar 22, 2015
    Posts:
    5
    Hi everyone.

    I have a GameObject with two childs, The chils only have a Transform component and sprite renderer.
    The GameObject represent a person so the childs are a head and a body.

    When either the father move or only the childs ,the head start to shake, but it is only visible in Tab game, in the tab Scene it don't happen.

    The camera don't follow the Gameobject so it is fixed.

    The sprite that move the Gameobject is it:

    this.transform.Translate ((this.transform.right * 2) * Time.deltaTime);

    I tried it in Update() and FixedUpdate() but I got the same result.

    Also I have tried it by rigidbody but the result is the same.

    I saw when the resolution is lower the shake is more than in bigger resolution.

    Thanks for reading me :)
     
  2. blizzy

    blizzy

    Joined:
    Apr 27, 2014
    Posts:
    775
  3. Alexbg

    Alexbg

    Joined:
    Mar 22, 2015
    Posts:
    5
    Thanks for the link, but my gameobjects are near 0.0. I have made a video to show what is the problem.

    Here is the video:


    I saw that in scene tab also happen that, but it less.

    Thanks for your time :)
     
  4. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    Are you sure this isn't just the normal erratic frame time causing this? That's what it looks like to me.

    Try a desktop build then select full screen and see if it smooths out. Also if you are not already doing so you should use time.deltatime for your movement updates so they become framerate independent. They may occasionally glitch around but at least the overall speed will be consistent.
     
    theANMATOR2b likes this.
  5. Alexbg

    Alexbg

    Joined:
    Mar 22, 2015
    Posts:
    5
    Thanks, when it is in full screen it smooths out and i already used Time.deltatime.
    You can be right, it could be the normal erratic frame time, but it is the first time that happen to me. Anyway, I don't have much time to investigate it, so if I find what is causing it I will write it here. Thanks for your help and your time :)