Hello Guest

Author Topic: Disappearing Animations  (Read 5218 times)

Maserat

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Disappearing Animations
« on: April 24, 2013, 04:28:53 pm »
I am having a very scary issue right now. I am using version 1.92 and am a week away from release. As I dive into tweaking my animations every now and again I will receive an index out of range error and a disappearing sprite on the screen. Once I track down the sprite animation, I find that the entire animation has been deleted. Somehow and without warning the prefab's animation data gets completely wiped. The worst part is that sometimes it happens to animations that I know I have not touched in months. Luckily, I can replace the animations by overwriting the prefab with a backup of the prefab.

EDIT: On the note of backups, is there any chance of implementing a text based animation? Having hard copied text files make me feel a lot safer than guessing if a prefab is empty or not.
« Last Edit: April 24, 2013, 04:58:28 pm by Maserat »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Disappearing Animations
« Reply #1 on: April 24, 2013, 11:42:10 pm »
Why don't you turn on text serialization?
You should be able to see most in text then, and also makes it a whole lot easier to merge with version control.

This is quite worrying indeed - I am pretty certain I got rid of the code that cleared out corrupt animations, but maybe not? Can you tell me the exact error message you get? The thing is though - if you get the error, something has corrupted that file in there.

Maserat

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Disappearing Animations
« Reply #2 on: April 25, 2013, 05:10:38 am »
Where is text serialization???
Unfortunately, there is no error or popup alert when the prefab gets emptied. I do not receive an error until I try playing the animation in preview. Then I get the this:

IndexOutOfRangeException: Array index is out of range.
tk2dSprite.Build () (at Assets/TK2DROOT/tk2d/Code/Sprites/tk2dSprite.cs:64)
tk2dSprite.Awake () (at Assets/TK2DROOT/tk2d/Code/Sprites/tk2dSprite.cs:37)
UnityEngine.Object:Instantiate(Object)
BullyController:Awake() (at Assets/My Assets/Scripts/Bully/BullyController.cs:177)

I also happened to lose more sprites again. It happened when I misclicked on a prefab. I get prompted to edit the name of the prefab but then I click on the correct prefab and then proceed to edit the animation. There seems to be some hiccup at this point which I say to my self "not again". The misclicked prefab gets cleaned, the intended prefab is safe, but for some reason other prefabs in different folders get cleaned as well(usually the animations being instantiated).

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Disappearing Animations
« Reply #3 on: April 25, 2013, 10:13:36 am »
http://docs.unity3d.com/Documentation/Components/class-EditorManager.html

That is really bizzare behaviour. I've seen this happen in the past, but its always been because of broken metadata due to a problem with version control.

What version of Unity are you using? And what version of tk2d specifically? Did you upgrade anything recently?

Maserat

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Disappearing Animations
« Reply #4 on: April 25, 2013, 05:11:08 pm »
It is definitely a problem with updating then. I upgraded to Unity 4.0.1f and TK2D 1.92final just over a month ago, and never had such problems.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Disappearing Animations
« Reply #5 on: April 25, 2013, 09:40:18 pm »
Ok. I can suggest one thing to make sure all the prefabs are in the right format for the new Unity release.
Switch to inspector debug mode, click on all your sprite animation prefabs in turn, and change one value in there, save assets, rinse and repeat. Make sure nothing is broken at that point.
Check in to version control, and make sure the prefabs have changed. If you have text serialization turned on you should be able to work out what has changed. Hopefully, nothing serious.