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.

Sprite Resolver: Animations sprite not changing

Discussion in '2D' started by MrCrayons, Feb 14, 2022.

  1. MrCrayons

    MrCrayons

    Joined:
    Jan 3, 2022
    Posts:
    20
    Hi everyone,

    I've attempting to use the Sprite Library and Sprite Resolver to optimise my project and make things easier for character customisations.

    I've used the Sprite Resolver to add my sprites into each actions animations, however when I perform an action in the game preview (e.g. jump) it flickers for a fraction of a milisecond and then reverts to the idle state sprite it started up with.

    When playing the raw animations in the correct sprites are in there. But when previewing the game the sprite doesn't change when jumping.

    I'm hoping I've just missed something really obvious but if anyone has any suggestions on what it might be it would be very much appreciated.

    (I'm using 2D animation package versions 5.0.9)
     
    TreeHacks likes this.
  2. MrCrayons

    MrCrayons

    Joined:
    Jan 3, 2022
    Posts:
    20
    An update incase anyone has this same problem. Rebuilding the animator from scratch seemed to do the trick. Not sure why and it was a big pain, but the main thing is it works.
     
    TreeHacks and ireeenuey like this.
  3. ireeenuey

    ireeenuey

    Joined:
    Jul 10, 2013
    Posts:
    1
    Thank you, was running into the exact same issue and tearing my hair out. This seems to be working for me as well.
     
  4. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    848
    Could it be that your Animator Controller contains clips animating both the SpriteRenderer.sprite and the SpriteResolver?
    If so, see this section from the 2D Animation documentation:
     
    TreeHacks and LaFleur like this.
  5. FashionPunk

    FashionPunk

    Joined:
    Mar 3, 2019
    Posts:
    1
    I’m going to necro this thread because after struggling with exactly this issue for a few hours I believe I found the correct solution.

    The animator layer had been set to “additive” in the layer settings with only one layer in the animator. Setting the layer back to “override” corrected the issue for me.
     
    MarekUnity likes this.
  6. JustinOaksford

    JustinOaksford

    Joined:
    Dec 27, 2022
    Posts:
    3
    I just wanted to flag that this was apparently the issue for me as well, after struggling for 5+ hours researching how to solve this issue.

    To be clear; I had explicitly *deleted* the "Sprite Renderer" Properties from all of the animation clips but whatever residue from that existed seems to be messing it up.
     
  7. moksheep

    moksheep

    Joined:
    Dec 7, 2022
    Posts:
    1
    After suffering from similar problems for hours, I found another way. In my case, I tried to change my image to Sprite Resolver, but it didn't work. So I "delete" it from the animation but it didn't work out the same way either.

    I don't know why, but I got rid of the sprite change in the anime window, but it seemed like there was a chigge left, and there was no change even if the engine was turned off or off.

    So here's how I found it:

    1. Remove all animations from the Unity Resources folder, then put them back in.
    2. Then open the anime window and you'll see the dregs that were originally deleted! Surprisingly...
    3. Erase it again.

    Got me on this thread by google search, but I hope people suffering for similar reasons can help.