- Home /
Unity reading animations incorrect when constraints used
Hi. I am making a character with a two-handed sword, and ever since I started using unity a while back it has not allowed for constraining one hand to the other inside of Maya, then exporting to unity. The animation bakes perfectly, there is nothing left but a skeleton with the animation data. No errors. Import it back into maya? It's fine, other software? it's perfect.
Into unity? Nope, the constrained hand will fly around wildly or be severely out of place.
I am actually sick of posting about this issue and not finding a fix. So please, if you know a way, help. I have reported it as a bug a long while ago without result.
My rig setup is as follows:
Control objects control skeleton/IK, that skeleton controls a slave skeleton via constraints, the slave skeleton is bound to the mesh.
The animation is baked onto the slave skeleton, everything else including all constraints are deleted from the scene. The only thing being exported is the slave skeleton with the baked animation onto it, and the only thing it had to bake was constraints rather than all the rig information.
During the animation the left IK hand is parent constrained under the right wrist slave skeleton joint. That constraint etc is all baked, so why can unity not read it properly when everything else can?
What file format are you using?
Why don't you just bake everything in $$anonymous$$aya and then export only the pure skeleton and the mesh? This way you will have only joints with animations and it will work...
I'm using fbx. As for the rest of your post please read my question properly :( I have already stated that I bake everything and export the 'pure skeleton'. And as for your assessment "it will work", nope, it wont work.
Still need a solution.. I can't make my character hold a two-handed weapon without one.
I read your post my friend. You are baking everything except the constraints and then you export the file as FBX to Unity, correct?
If yes how do you expect he FBX to hold the $$anonymous$$aya's constraints? It doesn't, so Unity does not know if there are constraints. $$anonymous$$aya's constraints are something specific to $$anonymous$$aya. Other softwares don't know how to handle $$anonymous$$aya's constraints. If you import whole animated rig as (.ma or .mb), Unity does not care about the rig, I$$anonymous$$ Handles, Constraints, etc. Unity just opens the rig in $$anonymous$$aya (In the background) and bakes the animation to the joints. This way might produce problems though. Don't use constraints, bake the movement that the constraints are holding and remove the constraints, then export to Unity.
If you want your character to be clean and import properly in Unity don't export to Unity anything else, than bones and bound mesh, in your case only the slave skeleton and the mesh. Every geometry, that moves with the skeleton have to be skinned.
I really don't think you read it... I specifically state all constraints are deleted from the scene. All animation is baked. There is NOTHING but a skeleton with animation on it. I don't think you've even tried to reproduce the error. I also specifically stated "During the animation the left I$$anonymous$$ hand is parent constrained under the right wrist slave skeleton joint. That constraint etc is all baked". You are posting in an ANSWERS forum using ASSU$$anonymous$$PTIONS as a basis for something you can't assume.