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

Is "root motion" worth it?

Discussion in 'General Discussion' started by JovanD, Aug 9, 2014.

  1. JovanD

    JovanD

    Joined:
    Jan 5, 2014
    Posts:
    205
    lately i've been having a lot of problems with Mecanim, mainly importing and root motion inaccuracies, so much so that it's costing me sanity at this point...
    So can some one explain to me pros and cons of Treadmill + Controller vs Root Motion?
    Should i keep trying to make it work or just forget that feature ever existed?
     
    GrayedFox likes this.
  2. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,266
    I liked root motion at first because of how natural animations can look with it, but it's posed some problems in terms of configurability. If I have some nice mocap of a roll, for instance, and I want to adjust the length of the roll based on a stat variable like a character's speed, then I'll need a blend tree with additional animations to control the distance of the roll. Likewise, if I want a character to be flung back according to the force of an impact. Etc.

    It's doable, but compared to just moving a controller I feel like it's more work.
     
    Rodolfo-Rubens and GrayedFox like this.
  3. calmcarrots

    calmcarrots

    Joined:
    Mar 7, 2014
    Posts:
    654
    I would apply root motion for a game like a third person shooter. If you are doing a platformer or FPS, you need a really smooth control system so root motion wouldn't fit (there would be a little lag between control and animation blending). I am doing a 2.5D arcadey platformer so I don't use root motion at all. Depends on the game.
     
    GrayedFox likes this.
  4. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    Or you could use the animation target matching.
     
    superpig likes this.
  5. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    I never use root motion, maybe their is a way to make it work well but considering the Unity Mechanim examples using it are completely unplayable I steer clear.
     
  6. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,266
    That's a good idea. Out of curiosity, do you (or does anyone else) use it on a regular basis? I've had nothing but grief trying to get it to behave at all naturally: animations will begin to match, stop, then snap suddenly to their matched target, or become stuck in place after the method call, or behave unpredictably when interacting with obstacles. I simply gave up on it as a technique after trying to make it work in 4.0. Perhaps it's been updated since.
     
  7. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    Are you sure you were implementing it right? I can't say I've used it extensively but its always behaved pretty much exactly as I expected. Here was a few hours of messing around:
     
  8. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,266
    That does look good; thanks for posting. I guess the matching is being used for the climbs and the jumps? My mistake is probably trying to use it as a more generalized movement solution (matching the root). Because MatchTarget only works within the context of a single animation clip, I found it rather untenable for controllers with layers and blending.
     
  9. dogzerx2

    dogzerx2

    Joined:
    Dec 27, 2009
    Posts:
    3,960
    Overall root motion is very nice. But I personally had some issues with ledge climbing, as you need to position a character based on hand's position, at the exact position of the ledge. But that was several versions ago, maybe some things have changed.

    Meow
     
    Stardog likes this.
  10. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,039
    The video doesn't show it very well, but all of the moves are target matched (rolls will match length of obstacle, jumping down matches feet position, etc). I'm not sure it would work for an overall locomotion solution (kind of defeats the purpose of root motion if you are always programatically setting position).

    But the main point is I didn't really see any of those snaps or pops that you mention.

    Again for a general locomotion system it might be quite different.
     
  11. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
    Root motion has always seemed incredibly cack handed to me. When you press forward, you want the character to go in a straight line, not an approximately straight line... Basic things like turning and moving sideways seem like they would be a total pain in the ass to get smooth.
     
  12. ChrisSch

    ChrisSch

    Joined:
    Feb 15, 2013
    Posts:
    763
    I don't have much experience with Mecanim's root motion, but I had trouble turning precisely and making it work with the camera/controls style I want for my 3rd person shooter (sort of like GTA III and up I guess). So I just switched to a rigidbody char controller. It's less realistic but works great for me. Maybe its harder without IK and other free version omitted animation features? I don't know, I didn't get into whats missing from Free much.
     
  13. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,793
    Mecanim rocks and I haven't had the issues described above.
     
  14. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,614
    For a player controlled character it's always a bit of a pain, yes. For NPCs it's much simpler.
     
  15. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,509
    I've been using it to control players. It gives a great feeling of solidness or roundedness to your character and their motion. Yes, it's a more costly way to do things in that it requires either an animator or something like Mixamo's tools in your pipeline. Is it worth it? Depends on whether or not that matters to you.

    I will agree that from a software design perspective it's... odd... to have animation (a presentation role) and locomotion (an input/functionality role) bundled together like that, though. Not necessarily bad - it could actually make workflows and responsibilities better/cleaner - but odd.
     
  16. ChrisSch

    ChrisSch

    Joined:
    Feb 15, 2013
    Posts:
    763
    I love Mecanim and find it really easy to use, and fun, and I do strive to have root motion for sheer realism, but for now sticking to addforce or rigidbody velocity to move till I'm a bit better at animating or making my char use root motion for turning like GTA IV char does (didnt play V yet). So far all my attempts resulted in incredibly in-precise turns with root motion. :p
     
  17. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
    I'm glad this is being discussed here. I've considered making a thread about it in the past. It's always seemed like an elephant in the room to me.

    Does anyone know if things are done this way in any AAA games? Such as GTA for instance (because everyone keeps mentioning it)?
     
    fourthrones20 likes this.
  18. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    I use Mecanim a lot but always without root motion, because all the control is lost with it. The steering is not anymore precise and if e.g. collisions happen the reaction if far too delayed as well.
     
  19. ChrisSch

    ChrisSch

    Joined:
    Feb 15, 2013
    Posts:
    763
    GTA IV looks like root motion to me. There, Euphoria is used I think. But another popular game like Skyrim is so not root motion. And its pretty obvious that its not very realistic either. I like Skyrim way more tho, didn't like GTAIV much, its not my type I guess. Regardless of root motion. xD
     
  20. JovanD

    JovanD

    Joined:
    Jan 5, 2014
    Posts:
    205
    I found a little workaround, i would animate and import only root bone and than use layers to combine it with animation.

    By the way can some one provide me detailed explanation on just how does Mecanim calculate/detect root motion and also center or mass, because im still having problems with some animations not previewing(preview window is blank)
    I really wanna know what can i do on my end to reduce those errors.
     
  21. SunnyChow

    SunnyChow

    Joined:
    Jun 6, 2013
    Posts:
    360
    some games use IK for the feet instead of root motion
     
  22. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
    The character controlling in Skyrim is really badly done, there's no doubt about that. What's even weirder about Skyrim is your character behaves totally differently in 1st person and 3rd person views.

    What do people think about Tomb raider or Assassin's Creed? I've always thought that they just make really good use of IK.
     
  23. ChrisSch

    ChrisSch

    Joined:
    Feb 15, 2013
    Posts:
    763
    I'm not really into Tomb Raider so I'm not sure which one is the latest one, but I watched my sis play the reboot one where Lara is young again, and that's definitely not root motion movement if you ask me. The latest Assassins Creed tho is hard to tell, they use a lot of motion cap animations and everything is so smoothed out with heavy IK its hard to tell, but I'd say that's also not root motion controlled. You can especially tell with the NPCs.

    EDIT: AC could be something like JovanD said. Or its just simply really smooth animations and controls.
     
  24. fourthrones20

    fourthrones20

    Joined:
    Sep 21, 2019
    Posts:
    10
    I'm trying to use root movement in my Diablo-style isometric RPG game. I am working with Apply Root Motion, but it seems to the fact that the cycle of the movement animations in the XZ item does not cycle normally (it is red). That Root movement is incorrectly transferred to the character's position, which is why, with each new cycle, the character's movement is thrown back. It's terrible, I still haven't figured it out. I made a post on this topic here - Link