Aseprite animations removed on project save

Hi, first post on here! ^~^

Basically, I am having a problem with my Animator component, where I can set up my animations to work nicely (via code) but as soon as I save my project, the second animation in the component gets removed.

The default animation “Barrel_Clip” does not get removed, only “Barrel backwards_Clip”.

I have tried numerous ways to fix this such as setting transitions and changing parameters or adjusting my code, but no matter how I leave it, the animation is removed on saving.

Both animations are imported from Aseprite.

Could someone please help me out with this? I have literally no clue what is going on.

I dont know what you do in code or exactly what you change

My guess would be you are trying to change an asset via code and not dirty’ing the asset. Unity doesn’t know the asset is changed and you get the unaltered version that is saved to the disk when you restart the game etc.

Look at Unity - Scripting API: EditorUtility.SetDirty

Hi, thanks for replying.

I don’t know if this was the case, my code was working fine it was just the saving issue, but I have since figured it out.

All I needed to do was have both sprite sheets/animations as part of the original imported sprite which I used for the prefab. Seems simple now.