How to make blender bones z axis forward in Unity

Hi. I’m importing models from Blender to Unity 3d. I want the bone’s z axis to always point forward, out of the bone when imported to unity. I’m quite sure that this is a Blender issue, not a Unity one, since I can’t transform the bone’s axes in Unity. Here’s two pictures of how the bones axes looks in Unity.



As you can see, the Z axis is up, when I really need it to point forward, out of the bone. I also want the y-axis of each bone to point in the bones up direction, and the x axis to point to the right. This is how it looks in Blender:


I’ve tried to change the .fbx export settings, but to no avail. I’ve set the forward axis to be Z forward, and the up axis to be y. This makes the entire model face the right direction (Z forward, Y up), but it doesn’t help with the bones. Is there any way to change this? If the model needs to be redone, how do you change the initial axes of the bones so that their z-axis always face their local forward when imported to Unity?

What you want is for Blenders axis to match those set up in Unity and short of some monstrous Python script, I doubt it could be done. You could rig your mesh with separate bones but what a pain that would be. I messed around with Unity for a while and I know how frustrating the axis change can be.

In FBX export settings select Armatures
Primary Bone Axis select Z Axis
Secondary Bone Axis select -X Axis