Nowadays I’m working on a 2D isometric game. I have layer-order issues. Normally I have 8-way directions movement system like every isometric games. My character and equippable items (potions, weapons, clothes etc) have 8-way directions specific different animations.
Please check 36-40th. seconds on video below. There is an character which has clothes and a weapon. This is 8-way direction movement on 2D. When he moves up-side, weapon hides normally. When he moves down-side or right-left side, weapon appears. This is all about sorting-layers on sprite renderer component, right?
Video Content.
So I have tons of items and clothes. I want to make that mechanism to my game. Should I handle all of different combinations and possibilities on animations when character moves to any direction? It sound terrible idea and probabbly too hard to work on this. So what is the tricks on that mechanics? How can I handle sprite render orders when he equipped seperate object?
You can set the sorting layer of your character and all of it’s child gameobjects through animations. I would recommend creating states for each direction that the player could walk, and then set the sorting-layer as appropriate for each direction. that way all you have to manage is which state you have transitioned to and the state machine will handle the various sorting layers. For different weapons you would just swap the sprite on the object.
Allright, I just thought that scenerio in the worst case. I already handle my character body animations. Meanwhile I should also change the sprite orders depends on animation directions right?
By the way, I have another question. I have a character which has tons of animations like idle, walk, attack, run, die etc. I also have seperated items that have same animations like my character. For example, Bow_Idle_South, Bow_Run_Right and so on… How can I manage all those animations with just 1 animator? Its totally non sense to make new animator controller for every single item.