Hello everyone!
Quite new here on the forums, actually first post so, yeah, hi again, and thanks in advance!
I’m currently working on a project where I want to have a player with a 2D sprite skeletal animation on a 3D world. Just so you have an idea: Don’t Starve. That kind of thing.
As far as I’m aware and being in a 3D world, the easiest way to control de “depth” (Z axis) of something is by setting up the pivot points on the sprites accurately and leaving them on the same sorting layer, this way they’ll render in front/back of other objects depending on their Z positions and their pivots.
That’s working alright, the problem comes when I have a sprite divided on parts, either imported on PSD file or sliced on unity from a PNG, since the pivot points of each part are relative to that specific part (Front/back arms/legs and main body) and they won’t render as intended (front/back priority) unless sorted by layers, which would be fine and easy, but that fucks up the depth priority for the rest of the world since as I mentioned they’re all on the same sorting layer.
I have tried creating a different sorting layer just for the character but still the same issue remains.
Any ideas?
P.S: I have noticed that if you apply the sprite texture to whatever 3D object, let’s say a plane, the depth still works fine regardless of the sorting layer you set the player sprite on the scene, 3D position and depth will take priority. This could be an option for the world itself but other creatures would still have the same issue if I keep them as 2D sprites. I guess I could just have planes instead of sprites, 3D bones and assign them the texture instead? But that kinda sound like a cheap and bad solution lol.