• RuntimesUnity
  • Altering draw order within runtime

Is it possible to alter the draw order when inside the Unity runtime.
Basically I would like to draw the character's arm and hand over the firearm.


Is it possible to achieve this with the current Spine Animation Unity Runtime?

Related Discussions
...

Sure, just change the order of Skeleton drawOrder. You may prefer to use an animation, then instead of your code changing the order, your code would apply an animation to do it. This allows it to be configurable in the Spine editor, where the animation is defined.

    Nate
    The operator and weapon are in 2 different spine animation files. I'm not sure I understand because even if I changed the drawOrder for the operator, the weapon would still be drawn before the operator completely, no?

    • Misaki відповіли на це.

      RogueWars In that case, you can use the SkeletonRenderSeparator component: https://esotericsoftware.com/spine-unity#SkeletonRenderSeparator

      You can add this component to the operator's Skeleton GameObject to split it into two SkeletonPartsRenderers: the forearm and the body. Then set the value of the Order in Layer property of the weapon's SkeletonAnimation component to a value between the forearm and the body so that it can be rendered in the middle. See the documentation for details on how to set this up.

        Misaki
        Thank you for the help, I got it to work.
        Great support as always.