Search Unity

  1. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice

Sprite Resolver: Animation Doesn't Work In Runtime

Discussion in 'Animation Previews' started by Dracalis, Apr 1, 2020.

  1. Dracalis

    Dracalis

    Joined:
    Oct 11, 2014
    Posts:
    6
    I'm trying to use the Sprite Library and Sprite Resolver to swap character sprites in an animation. My intention is to create one set of animations that I can use amongst all characters in my game, just by swapping the sprite sheet. It isn't working as intended though.

    The documentation says I should change the Label in the Animation, though the closest property I have to that is "Label Hash". I made keyframes of that, then set the dopesheet's key frame tangents to Constant.

    In the editor, the animation preview seems to work fine:
    Sprite Swap Preview.gif

    But in runtime, it looks like this:
    Sprite Swap Runtime.gif

    And when I try to inspect the curves in my animation, I get this error:

    Mesh 'ControlPointRendererMesh': abnormal mesh bounds - most likely it has some invalid vertices (+/-inifinity or NANs) due to errors exporting.
    Mesh bounds min=(36.00, -nan(ind), 0.00), max=(1064.00, -nan(ind), 0.00).
    Please make sure the mesh is exported without any errors.
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    Has anyone had success doing frame-by-frame sprite swaps in 2D animations using the Sprite Resolver? I'm not sure what I'm doing wrong here.
     
    Last edited: Apr 1, 2020
  2. Leo-Yaik

    Leo-Yaik

    Unity Technologies

    Joined:
    Aug 13, 2014
    Posts:
    342
    Can you share the project with us? You can drop me a PM on a link I can download the repro. Thanks
     
  3. ink13

    ink13

    Joined:
    Nov 14, 2013
    Posts:
    23
    Hey I'm having the same issue - is this something i can easily fix myself?
     
  4. ink13

    ink13

    Joined:
    Nov 14, 2013
    Posts:
    23

    Did you ever figure this out?
     
  5. ink13

    ink13

    Joined:
    Nov 14, 2013
    Posts:
    23
    Ah, if anyone ever gets lost here... It was my mistake. The curves weren't setup correctly on my side.
     
unityunity