Hello I have some 2d character in sprite I've rigged to use in Unity 2D.Something like this, with separate body parts. Although I've used weights and geometry, these body parts are supposed to move independent of each other, so there is no stretching/blending (or whatever you call it) of the shapes/body parts. Now I've created the rig successfully, I realize that these body parts are no at the order I want, meaning some parts are overlapping others in the wrong order. How should I fix that?
It's really simple, but Unity changed the interface recently so most of the tutorials weren't helpful and I didn't know what keywords to look up.
So if you click on the sprite image in the asset folder, go to Sprite Editor in the Inspector, then click on skinning editor (at the top left corner), and then you double click on the image for the bones to show. And then click on a bone, and it allows you to edit the depth of each bone. So that's it.
you would want a seperate game object in the scene for each part. You can use the "order in layer" property on the sprite renderer, or the z value to determine what draws on top of what. You should build your character has a hierarchy of sprites, and use the parent/child relationship to make the objects pivot how you like. For example you can have
bodySprite shoulderJoint armSprite
In this case body sprite is the body, shoulder joint is located where you want the arm to connect, then the arm is a child of the shoulder joint, and you offset it down so the top of the arm connects with the shoulder. Now if you rotate the shoulder joint, the arm rotates around the shoulder.