Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Problem with animated sprite sheet

Discussion in '2D' started by Mastropiero, Dec 1, 2013.

  1. Mastropiero

    Mastropiero

    Joined:
    Dec 1, 2013
    Posts:
    12
    Hello! im trying to make my own 2D game, and now im trying to animate my little player, so i made a sprite sheet in corel draw and used it with this script:
    http://wiki.unity3d.com/index.php/Animating_Tiled_texture_-_Extended

    The problem is, my player can move perfectly left and right, but when its standing still, it moves a little on its own, like its vibrating. Anyone have any idea why? thanks!

    sprite:
    [img=http://s7.postimg.org/5ubf8atdz/personaje_animado.jpg]

    Im also using this script to make it move left and right:

    #pragma strict
    function Start () {
    }
    function Update () {
    var AT = gameObject.GetComponent(AnimateTexture); //Store AnimateTexture Script
    if(Input.GetKey("a")){
    //Player moves left
    AT.rowNumber = 1;
    //Change to running animation
    } else if(Input.GetKey("d")){
    //Player moves right
    AT.rowNumber = 1;
    //Change to running animation
    } else {
    //Player is not moving
    AT.rowNumber = 0;
    //Change to idle animation!
    }
    }
     
  2. Mastropiero

    Mastropiero

    Joined:
    Dec 1, 2013
    Posts:
    12
    So anyone knows whats wrong? maybe another script to use or another way to make the prite sheet? :(