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

Animation issue using spritesheets

Discussion in 'Animation' started by Svdl, Apr 18, 2018.

  1. Svdl

    Svdl

    Joined:
    Jul 4, 2017
    Posts:
    2
    Hi guys,

    I apologize if I don't post at the right place.
    I encounter an issue with 2D animations and spritesheets when you drag and drop from Project Window to Animation Window. You can easily reproduce it, just use a spritesheet with more than 16 sprites following this steps :
    - create a GameObject, add the SpriteRenderer and Animator components
    - in the Folder Window, create an AnimatorController and an Animation
    - attach the AnimatorController to the Animator components of the GameObject
    - drag and drop the Animation into the Animator Window
    - select all the sprites of the spritesheet, drag and drop them to the Animation Window at key 0.
    - then look at the order of the images : "sprite_0" is at 0, "sprite_1" is at 1, "sprite_2" is at 2, ...., "sprite_16" is at 16, "sprite_16" is at 17, "sprite_17" is at 18, "sprite_18" is at 19, .... and come back normal after a while (..., "sprite_30" is at 31, "sprite_32" is at 32, ...).

    I found the issue because I saw a little lag in an animation at runtime. I don't know if it is a known issue, if it already has been reported or fixed, so I report to you. I saw it on Unity 5.6.0f3 several months ago, I by-passed it "drag-and-droping" sprite by sprite. But now I'm working on an other project with a lot of spritesheets of many sprites, I'm using Unity 2017.3.0f3, and the issue is still there. I suppose it's not really important because it's not blocking (if you don't care, you don't see it), but a little bit anoying all the same.

    Do you have more informations about this?
    (Or what am I doing wrong?)

    Thanks in advance.
     
    Last edited: Apr 18, 2018
  2. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    295
    Hi Svdl,

    I managed to reproduce your issue in our development version. I believe this is limited to previewing sprites in the Animation Window, so it shouldn't affect playback in game otherwise... I logged a bug report, so we will have a look at it!

    Whenever you want to report a bug like this, you can use the bug reporter in the application to do so ("Report a Bug" in the "Help" menu). This way, you can be sure your issue will be tracked in our database :)

    Cheers :)
     
    Last edited: Apr 19, 2018
  3. Svdl

    Svdl

    Joined:
    Jul 4, 2017
    Posts:
    2
    Hi Simonbz,

    Thank you for your reply. The next time I will use the bug reporter.

    I assumed it was present at runtime too because I remember I saw it at runtime. So I just made some tests to verify (on Unity 2017.4.1f1), using Animation Events to track the order of the sprites, and it seems to be actually right at runtime and affects only animation preview. Furthermore, if you change the "Samples" of the animation, it put the sprites at the right order...

    Well, I will not have to drag and drop hundreds of sprites one by one... A really good news !

    Thank you for your time !