Search Unity

Animation problem with sprite resolver.

Discussion in '2D' started by mmn_tlh, Aug 29, 2021.

  1. mmn_tlh

    mmn_tlh

    Joined:
    Jun 30, 2018
    Posts:
    4
    Hello!

    I am trying to animate my pixel art character using the sprite resolver, problem is the animation works correctly with 60 samples in the clip in play mode, but I want to only have 12 samples, I made everything by following the documentation and by taking a look at the sample "Flipbook animation swap" (this is basically what I want to achieve so i can make skins, so I can have multiple characters without remaking all the clips for each of them). Animation clip does work exactly how I want when I play it using the animation tab but messes up when I enter play mode. please checkout the gifs:

    In editor:

    In play mode:




     
  2. MarekUnity

    MarekUnity

    Unity Technologies

    Joined:
    Jan 6, 2017
    Posts:
    207
    That's great, it looks like a correct setup for your case.
    Did you change the keyframe tangent to Constant? Also make sure that other animation / scripts don't override your Sprite Resolver values. If the issue still persists you can share your setup with me in a private message.
     
    DeadCastles likes this.
  3. mmn_tlh

    mmn_tlh

    Joined:
    Jun 30, 2018
    Posts:
    4
    Hey Marek, ̶Y̶e̶s̶ ̶I̶ ̶d̶i̶d̶ ̶c̶h̶a̶n̶g̶e̶ ̶t̶h̶e̶ ̶k̶e̶y̶f̶r̶a̶m̶e̶ ̶t̶a̶n̶g̶e̶n̶t̶ ̶t̶o̶ ̶c̶o̶n̶s̶t̶a̶n̶t̶,̶ ̶a̶n̶d̶ ̶I̶ ̶t̶e̶s̶t̶e̶d̶ ̶e̶v̶e̶r̶y̶t̶h̶i̶n̶g̶ ̶a̶g̶a̶i̶n̶ ̶w̶i̶t̶h̶o̶u̶t̶ ̶a̶n̶y̶ ̶s̶c̶r̶i̶p̶t̶s̶ ̶t̶o̶o̶ ̶t̶h̶e̶ ̶i̶s̶s̶u̶e̶ ̶i̶s̶ ̶s̶t̶i̶l̶l̶ ̶t̶h̶e̶r̶e̶ ̶I̶ ̶f̶e̶e̶l̶ ̶l̶i̶k̶e̶ ̶i̶t̶ ̶h̶a̶s̶ ̶s̶o̶m̶e̶t̶h̶i̶n̶g̶ ̶t̶o̶ ̶d̶o̶ ̶w̶i̶t̶h̶ ̶h̶o̶w̶ ̶i̶t̶ ̶i̶s̶ ̶r̶e̶n̶d̶e̶r̶i̶n̶g̶ ̶t̶h̶e̶ ̶a̶n̶i̶m̶a̶t̶i̶o̶n̶,̶ ̶I̶ ̶w̶i̶l̶l̶ ̶s̶e̶n̶d̶ ̶y̶o̶u̶ ̶t̶h̶e̶ ̶p̶r̶o̶j̶e̶c̶t̶/̶ ̶s̶c̶e̶n̶e̶.̶

    Was writing you this reply then decided to create a new animator controller now it seems to work fine.
     
    MarekUnity likes this.
  4. mmn_tlh

    mmn_tlh

    Joined:
    Jun 30, 2018
    Posts:
    4
    Also just wondering if there is a faster way to add sprites into the sprite library asset? Kind of slower to put each sprite one by one.
    @MarekUnity
     
  5. MarekUnity

    MarekUnity

    Unity Technologies

    Joined:
    Jan 6, 2017
    Posts:
    207
    I'm glad it's working.

    If you're using 2D Animation 6.0 or higher (Unity 2021.1+) you should be able to populate categories by dragging and dropping single sprites or sprite sheet textures. Here is the documentation page describing it: https://docs.unity3d.com/Packages/com.unity.2d.animation@6.0/manual/SLAsset.html#drag-and-drop
     
  6. MarekUnity

    MarekUnity

    Unity Technologies

    Joined:
    Jan 6, 2017
    Posts:
    207
    @mmn_tlh I'm looking forward to getting some feedback on the Sprite Library Asset window and the drag & drop behavior. Feel free to share your thoughts on the tool and if you feel that some functionality is missing or you would like to see something improved and why.
     
  7. AdamBebko

    AdamBebko

    Joined:
    Apr 8, 2016
    Posts:
    168

    Omg, this is a lifesaver, couldn't figure this out after a long time, My animator kept sending me things that seemed to work in the animator screen, and when using them in playmode just simply wouldn't work. Finally found this forum post, and magically all the animations are beautiful. Perhaps this should be more clear in the docs!
     
    MarekUnity likes this.
  8. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    Happy that you managed to resolve the issue, @AdamBebko and thanks for letting us know!
    In Unity 2022.1 and onwards, you no longer need to update the keyframe tangent to Constant, the Sprite Resolver will just work with the Animation Window without any additional settings.

    For Unity 2021.3 and older, we have a section in our 2D Animation docs which mentions this step, but it might be a bit difficult to find. Thank you for your feedback!
     
    AdamBebko likes this.