Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Mecanim Root Motion for Generic Rig - Quadruped

Discussion in 'Editor & General Support' started by Liveon, Feb 11, 2013.

  1. Liveon

    Liveon

    Joined:
    Jul 9, 2012
    Posts:
    13
    Hi, I have been through some of the major tutorials to use Root Motion in my game. So far all of them in the demo projects have used Humanoid Rig (apart from mine_bot which is NOT using Root Motion). However, my model is a four legged quadruped animal and have Root Motion in animation so humanoid rig is not applicable. As far as I know, I need to use the Generic Animation Type rather than Humanoid.

    Problems:
    When I enable "Loop Pose" for walking animation and adjusted the time slider, the animation starts moving "in-place", which is very strange because I have Apply Root Motion checked. I need the animation to translate itself using Root Motion. I do not wish to translate movement using script.

    My question is:
    Did I miss something or is the model not prepared properly for Root Motion (which I thought might be the case). And I did set the Root Node for the model.
    Is there a tutorial for Quadruped Root Motion tutorial that I'm not aware of?

    Any advice or reference tutorials would be great!
     
    Last edited: Feb 11, 2013
  2. Alf203

    Alf203

    Joined:
    Dec 7, 2012
    Posts:
    461
    Apparently its a bug. Root motion doesn't seem to work with generic. Check this thread :

    http://forum.unity3d.com/threads/160908-Generic-mecanim-root-motion-problem

    If your model has enough bones and a similar hierarchy needed for Humanoid, the quickest solution for now would be to make it humanoid even if humanoid setting is not made for quadruped. So Map two of the legs as arms and such. It wont really matter if its set to humanoid because you wont use the retargeting on this model anyways. Using Humanoid will make the root motion option work.

    When they fix it you can always change to Generic if you then choose to do so.
     
  3. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Just to make it clear Mecanim Generic works with root motion. However you need to set the correct Root node in the Rig section for models and animations, this should be the node that actually contains the root motion that you want applied to your generic model.

    I'll send out an internal notification that a tutorial about this would be helpful.
     
    theANMATOR2b likes this.
  4. Alf203

    Alf203

    Joined:
    Dec 7, 2012
    Posts:
    461
    I think a lot of us thought there was something wrong with it. Thanks a lot for clearing that up !
     
  5. Liveon

    Liveon

    Joined:
    Jul 9, 2012
    Posts:
    13
    Thanks for clearing this up! I almost gave up on this. Yes a tutorial for this would be very helpful for everyone! In the mean time I'll see what problem is with my FBX model.

    Cheers
     
  6. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    You can easily test it by using the humanoid fbx files. Just be aware that we shipped some fbx files with an extra animation rig in them. The correct root node for the dude and his animations is "Reference/Hips" and not "Character_Ctrl:Reference/Hips 1". As long as you set this root node you can use Mecanim Generic on the dude as well. Also remember that retargeting does not work with Generic so you can't mix and match the same way as you can with Mecanim Humanoid.

    For starters we'll be posting an updated version of the Sample scenes without the confusing animation rigs in them soon.
     
    Last edited: Feb 12, 2013
  7. Liveon

    Liveon

    Joined:
    Jul 9, 2012
    Posts:
    13
    I can confirm that it works. Thanks for the support. Just have to remember to select the correct Root Node in the FBX model.
     
  8. JeppeNygaard

    JeppeNygaard

    Joined:
    Dec 7, 2010
    Posts:
    13
    The game we're currently doing we have 7 4-legged creatures so we would VERY much like to find a solution for having generic rigs do loop with continious root motion - but we can't find the needles in the hay stack - I was hoping you could help!

    Here is a video showing our issue:

    [video=youtube_share;DyrwfGwr9fM]http://youtu.be/DyrwfGwr9fM

    Hoping to hear from you!

    Thanks
    Jeppe
     
  9. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    The way to locate the "correct" root node is to open the model in your 3d tool and see what bone contains the motion that you want Unity consider the root motion. The modeller/animator can call this bone whatever they want to and Unity is not the right tool to find this bone with.

    But just to clarify what the "root bone" is, its the parent bone that contains the motion that you want Unity to MOVE your transform with. So its the one that goes from the mark on the floor and to where ever the model is located.

    So it could be like this:
    $rootnode.jpg
    But it could be thousands of other configurations which is why we can't auto detect it and so we need you to point us to it.
     
    afano likes this.
  10. JeppeNygaard

    JeppeNygaard

    Joined:
    Dec 7, 2010
    Posts:
    13
    Thank for your quick response - and your clarification!

    As it turns out this seems to be something as simple as an exporting issue from maya. I couldn't get it working with maya native .mb files and fbx files exported from maya2013 didn't work either. As soon as I exported the animation from maya2012 using fbx2012.1 everything works perfectly

    Thanks
    Jeppe
     
  11. TWaanders

    TWaanders

    Joined:
    Mar 27, 2013
    Posts:
    46
    Hi Jeppe,

    Was wondering what your procedure was for rigging the sheep in Maya.
    I manage to get my animations in Unity, but despite my root bone, the model shifts up and down in Unity.

    Problem is that I have no clue as to where it goes wrong, especially since the animations work nicely but I somehow can't get the character to stick to the ground without it going off in the air. In Maya it sticks to the floor.

    Maya 2012 with FBX 2012 exporter should be fine I read, so I am starting to think that it might be something wrong with my rig, or perhaps with the animation itself.

    Please check the images for an illustration of my problem. I am rather new to animating in Maya, so perhaps I should change something in the graph editor.


    The import looks good, root bone centered at origin exacly as in Maya.

    $01rootOrigin.jpg

    When I play the animation in Unity's animation preview, however, the model shifts upwards and starts floating. The animation itself is exactly the same, no issues here, just the vertical position it seems.

    $02rootFloat.jpg

    Any thoughts on what goes wrong here? I'm stuck at this issue for days now, any help is greatly appreciated!

    Thanks

    Thijs
     
  12. TWaanders

    TWaanders

    Joined:
    Mar 27, 2013
    Posts:
    46
    Anyone?
     
  13. PawelBodytko

    PawelBodytko

    Joined:
    Feb 17, 2013
    Posts:
    35
    I don't use Maya, but I had some issues similar to this in Max. I've developed a system where every time I export a character to FBX, I import it back to a blank scene in Max and correct any issue that might happen with export. Then, stripped of the native Max functions I export it back to the same FBX file. Looking at the flow chart in Max I can quickly see if the rig was set up correctly.

    On another subject -- how did you set up and bring the cat's hair to Unity? It looks awesome!
     
    theANMATOR2b likes this.
  14. TWaanders

    TWaanders

    Joined:
    Mar 27, 2013
    Posts:
    46
    Hi, thanks for your reply. The hair was done using transparant planes set up around the kitten. No fur shading here.

    Still didn't find a solution to the issue. Sigh.

    Guess I will have to redo the entire rig since Unity doesn't seem to 'get' it :/
     
  15. BitmenStudios

    BitmenStudios

    Joined:
    Mar 30, 2013
    Posts:
    2
    Did you try to bake the Root Transform Position (Y) into the pose in Unity? That should solve your issue.
     
  16. esaucv

    esaucv

    Joined:
    May 25, 2013
    Posts:
    1
    im not speak english,but i tried to help you with your problem, i have the same problem and i fixed, just constrain parent traslate y axis of joint up root herarchy, to the joint root.
    remember constraint in frame 1.
    in my case principal_reference move equal to principal hips.

    im speak spanish, if you speak spanish, i can explain me more.



    $solve_problem.jpg
     
  17. TWaanders

    TWaanders

    Joined:
    Mar 27, 2013
    Posts:
    46
    Thanks for you reply esaucv!

    This seems to do the trick. In my case I redid the rig and did not run into the problem anymore, but it is very good to know how this works :).
     
  18. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    someone here i try make animation in unity but it's look not working at this time
     
  19. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    if Quadruped have same bone i can use mecanim please ?
     
  20. Neoku

    Neoku

    Joined:
    Oct 27, 2014
    Posts:
    261
    Someone has luck using Mecanim with quadruped rigs?, exist a tutorial for this? thanks.
     
  21. Spartan_Boy

    Spartan_Boy

    Joined:
    Jul 8, 2012
    Posts:
    38
    Hi all, does it mean it will follow terrain as well, meaning feet stuck to irregular terrain ?
    THX, because i had no luck so far!
     
  22. GilesDMiddleton

    GilesDMiddleton

    Joined:
    Aug 12, 2015
    Posts:
    91
    Did a tutorial ever get created? I've got basic walking of quadrupeds sorted quite easily, with an independent root-motion bone, but making a non-looping & rotating animation suffers issues. So would love to see a proper rig configuration & best practice.