Hi everyone,
first of all, i'd like to tell you that i've read the documentation, but i'm afraid i simply can't understand how to do what i intend to do because this is all quite new to me.
I was given a task to animate an enemy that has a body and three body parts. I have the skeleton data with the body animation that i put on layer 0, and three animations for layering:
Body part 1 off layer (which contains the body with body part 1 missing, parts 2 and 3 intact)
Body part 2 off layer (which contains the body with body part 2 missing, parts 1 and 3 intact)
Body part 3 off layer (which contains the body with body part 3 missing, parts 1 and 2 intact)
When the first body part gets destroyed, i play the Body part 1 off layer
PlayAnimation (1, "part 1 off layer", true);
When the second body part gets destroyed, i play the Body part 2 off layer on track 2
PlayAnimation (2, "part 2 off layer", true);
When the third body part gets destroyed, i play the Body part 2 off layer
PlayAnimation (3, "part 3 off layer", true);
It all works dandy, the higher layers are hiding the layers below so i get the enemy with one less, two less and without body parts.
BUT, there comes a moment in which i have a problem. The guy regrows the body parts, so i need to do the same in reverse order, make body parts appear one by one. I tried with
animator.AnimationState.ClearTrack(3)
to remove the last track, but that doesn't to the trick. I tried clearing tracks 1, 2 and 3 the playing the animations again, but the guy is still limbless. Of course, it has to be in a manner that the body parts can be layered again.
Any help is appreciated.