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

Question How to fix this animation issue

Discussion in 'Animation' started by darthcoder567, Jan 26, 2023.

  1. darthcoder567

    darthcoder567

    Joined:
    Aug 20, 2022
    Posts:
    45
    I created a sprite sheet and then sliced it for an animation but when I started the animation the sprite moves side to side during the animation. I checked the sprite sheet and I sliced the sprite equally does anyone know what's going on and how to fix this?
     
  2. Unrighteouss

    Unrighteouss

    Joined:
    Apr 24, 2018
    Posts:
    599
    It sounds like the sprites on the sprite sheet are placed incorrectly. If you attach the sprite sheet here I can confirm this.
     
  3. darthcoder567

    darthcoder567

    Joined:
    Aug 20, 2022
    Posts:
    45
    This is the sprite sheet
     

    Attached Files:

  4. Unrighteouss

    Unrighteouss

    Joined:
    Apr 24, 2018
    Posts:
    599
    Yup, you need to have the sprites in the same place for each tile. If half of the sprites are on one side, and half are on the other, the character will teleport around during animation.

    It needs to look something like this:
    2023-01-28 (Fix).png
     
  5. darthcoder567

    darthcoder567

    Joined:
    Aug 20, 2022
    Posts:
    45
    How do I move the sprite over like that?
     
  6. Unrighteouss

    Unrighteouss

    Joined:
    Apr 24, 2018
    Posts:
    599
    You can't do it in Unity, you need to use an image editing software like Photoshop or Krita.
     
  7. darthcoder567

    darthcoder567

    Joined:
    Aug 20, 2022
    Posts:
    45
    Thanks for the help!:)