Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Mass center not moving during animation

Discussion in 'Animation' started by Isaac-Udy, Feb 2, 2015.

  1. Isaac-Udy

    Isaac-Udy

    Joined:
    Aug 4, 2013
    Posts:
    5
    Hi,

    I am trying to create an animation that moves the character. If the animation is left looping, I want the character to continue moving at the end of each loop of the animation. Apparently Unity can do this, but I am at my wits end trying to get this to work. I have created an animation in Blender, which I want to use in Unity. I have watched the mechanim tutorial, but I am still having big issues.

    Look at the following screenshot:
    upload_2015-2-3_0-21-56.png

    This is a screenshot of the preview window of the animation, as I am dealing with the import settings. In the mechanim tutorial video, that little circle (Mass center and pivot) moves with the model as it animates. However, as you can see in my case, the mass center and pivot stays at the origin, and does not move. This means that my animations walk for one loop, and then the model snaps back to the starting position. I want the character to continue walking forward.

    I can make the mass center move if I set the rig to generic, and set one of the nodes as a root node. However, this doesn't work correctly because it seems that 1/2 of the model will animate much faster, causing meter-long neck stretches out the back, or the legs to run away from the body (causing the torso to stretch and be more than a meter long).

    If I set the rig to humanoid, the animation simply shows NO movement at all. It suddenly becomes an in place animation, even though I have tried this with root motion both turned off and turned on.

    Please help me. I am really struggling here.

    It may be worth noting I have tried importing the model as both a .blend file, and a .fbx file.
     
  2. medhue

    medhue

    Joined:
    Aug 24, 2014
    Posts:
    176
    It would be interesting to see the set up in Blender. Generally speaking, you need to have a root bone that can move the avatar in global space, and then another bone that is generally the Center of Mass bone, and moves the avatar relative to the root bone. If you don't have both of these, then I'm not sure you can get the desired outcome you want.
     
    theANMATOR2b likes this.
  3. Eidan1985

    Eidan1985

    Joined:
    Jun 3, 2015
    Posts:
    1
    Hi Isaac, did you find the solution of your problem? cause´ I have the same problem, in my case I imported a model in Blender from Makehuman, then in blender I imported a BVH file to that model. I saved this model as a .blend file, so then, in Unity, when I open this model, the mass center is not moving with the animation... what could be the problem? I hope you´ve found the solution...
     
  4. Isaac-Udy

    Isaac-Udy

    Joined:
    Aug 4, 2013
    Posts:
    5
    Hey Eidan,

    I believe I solved the problem by adding an extra bone that was just floating around in space, but attached to one of the other bones in the rigging, which then meant that I could set that as the root bone and the player would move with it.

    I can't remember 100% because I have since started using Mixamo to do all my rigging.

    I hope this helps!
     
  5. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Not to impose on the blender conversation - cause I use Max :) - but it seems the op didn't animate the root bone so clicking apply root motion would not help in that instance. As he explained he parented the base (root-most) bone to either the original root or a new root which gave the character locomotion.
    @Isaac.Udy to control the character using root motion - the root bone needs to move in blender.
    Make sure the root bone is propelling the character in blender before exporting into Unity.
    You can actually overcome this if the root bone isn't animated by using code to move the character (I don't do this) or if you parent the root bone to an empty game object in Unity and animate the empty game object as if it was the root.
    Best to move the root bone in blender and export though.