Positioning imported armature with animation (from blender)

I have imported an armature with animation from blender.
The object is always at the position which I put it in blender (I instantiated it by calling GameObject.Instantiate)
I understood that position keys are imported from blender that’s why it happens and that I need to put my object into an empty parent object and position the parent.
Still, if I move the parent object (in Scene view or from code, setting parent.transform.localPosition), my object does not move.
Any ideas? Thanks,
(I need the position keys for the animation)

I solved it finally.
Let me tell others looking for the solution wtf, because most of the tips returned by Google are about positioning the parent object which might not work; there are plenty of ways to shoot yourself in the foot :wink:

  • First. I instantiated the blender object, which was wrong (using Resource.Load() then GameObject.Instantiate() )
  • Second, I instantiated the blender armature, which is also wrong.
  • Finally, I instantiated the blender file itself, which only contains an armature and the animated object and its animations but no other objects or armatures. It’s not a good practice anyways to mix more objects into a single file, bones with the same name are not handled by the exporter…

So Resource.Load() for the blender file itself (without extension) and instantiate that. It will create one root object in the scene with two child objects: the armature and the mesh. The root object has an Animator component attached which can be used for scripting the animations.

(…then an Animation Controller is needed which I had to load runtime like

animator.runtimeAnimatorController = (RuntimeAnimatorController)RuntimeAnimatorController.Instantiate(UnityEngine.Resources.Load(“controller name without extension”));

but that’s another story)