I have a case where I play an idle animation with the character looking down and the arms are drawn behind the torso.
I then aim a gun, where I control the angle of the arm from within Unity, I want the arm holding the gun be in front of the torso.
This should happen only when looking down, not left/right/up, and holding a gun. I tried fiddling with moving the arm slot up/down X positions, depending on where he looks, like this: change the draw order at runtime
However it's getting very complicated when I don't have absolute draw orders, and also I need to override it each frame, since the idle animation changes the draw order too.
So can I add a new TrackEntry, which contains only the arm slot and its draw order? I guess not, as the draw order is for all slots..
Or can I make a deep copy of the draw order list, and then override it for each frame as long as he's looking down?
Thanks!
I'm currently trying this to store the correct draw order from another animation track:
currentMovementTrack = skeletonAnimation.AnimationState.SetAnimation(movementTrack, "shoot_test", true);
drawOrderArm = new ExposedList<Slot>(skeletonAnimation.skeleton.drawOrder.ToArray()); // Clonse draworder from shoot_test
However, it seems as skeleton.drawOrder doesn't contain the draw order at the exact time as I do SetAnimation. is that correct? Can I force it to update?