- Home /
Blender exported to Unity, bone rotation and parenting.
I created a model and exported the *.fbx to unity. Now when manipulating the bone with rotation, it faces to the opposite direction. I tried to do it as described here http://answers.unity3d.com/questions/4028/how-do-you-rotate-a-bone-towards-a-given-target/23085#23085
But when I set the bone as Parent to the bone which faces opposite in the object editor, it fucks up the position of the bone, and I see the mesh doubled in unity. Beyond that, it does nothing when I try to manipulate the bone which faces opposite.
I tried to add a Bone Constraint, which works fine in Blender, but exported as *.fbx to unity, it doesn't work there. I guess Bone Constraints aren't exported.
So, how do I need to configure the bones so I can manipulate them in unity without them to face in the opposite direction?
I'm using Blender 2.56
Answer by Kona · Jan 01, 2011 at 08:31 PM
Make sure your bone axis are set up correct. Hmm, about the fuck-up thing when you set bones as parent, could you post a picture of it? I'm not sure I understand it.
Also, are you using IK's in blender? I tried importing a rig with IK's from blender and my character gone crazy for some reason, even though the IK were set up properly and IK settings in unity was checked.
The axes weren't correct, that's why it was fucked up at parenting. So thanks for that tip. Basically the bones were moved and rotated to another location when the axes weren't correct.
It's a very basic model for testing, so there aren't any I$$anonymous$$'s.
http://img209.imageshack.us/i/cannon.png/ At this screenshot the marked (small) bone is set as parent to the unselected bone facing in the opposite direction. Set up like this in Blender, when I rotate the unselected bone, the selected bones rotate in the same fashion. The other picture in the image is the outcome in Unity.
I've never had any similar trouble myself and to me it seem really weird so I'm not sure on how to solve it but I would check if the bone is connected in blender. if you have a bone set up in opposite direction than the rest in the armature and that bone is set to be connected with its parent it will set the parents origin as it's own pivot.
So if it's connected to its parent try disconnecting it but still keep its parent.
The bones facing in opposite direction are not directly connected. I don't think it's even possible to have 2 bones like that in one armature. Somehow when I set a bone as parent, export it as fbx, and import it into unity. A copy of the parenting armature is created and acts as part of the child bone. That's why there are 2 cannons. When I delete one cannon it's fine to use the model and everything works as wanted. But somehow it's an unclear way of doing it.
Err. wait, did I misunderstand you now or are you using 2 armatures for your mesh? In that case I'm pretty sure that's the problem. I usually have bones facing in opposite directions in my character rigs so it works fine doing that, haven't had any problems with it yet not even with ragdolls. :)http://et-aw.com/datas/users/276-rig.jpg
O$$anonymous$$, that fixes it. I always thought it wasn't possible to have 2 connected bones to face in different direction. Thanks for your help!