Hello everybody!
Before I ask my question I’ll go over my setup:
I’m trying to render 2D sprites with layers in a very literal way. In the simple example that I currently use, a sprite consist of a handdrawn body and a head. The sprite is constructed in blender by using two planes: one for the body and one for the head. The two planes are textured accordingly with the handdrawn body and head. The plane of the head is of course moved in front of the body to display the sprite correctly. Finally, I have assigned a bone to each plane so I can animate the sprite by moving the bones in blender while still being able to, for example, assign rigid bodies in Unity to the head and body seperately. One final thing of note is that in practice I have four planes instead of two (I have a mirrored version of the character taped to the back of the character so that I can flip him around, rather than having to mirror the uvs). I don’t want to script the mesh into animation but it is crucial to what I am trying to achieve in the long run that all the animation is done in Blender.
Importing this mesh to Unity works like a charm except for the fact that the head is displayed behind the body, even though I can see clearly in the editor that the plane (or rather, the head transform) is positioned closer to the camera than the body. Keep in mind though that the character is treated as a single mesh in unity. If I have ruled out the possibility that the head displayed behind the body is in fact the mirrored version and that it would thus be a problem with the normals. Any idea how I can fix this?
Is unity’s z-buffer unable to deal with disjunct meshes?
Much obliged,
Sam