Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Generic mecanim root motion problem

Discussion in 'Editor & General Support' started by DragonByte, Dec 1, 2012.

  1. DragonByte

    DragonByte

    Joined:
    Sep 30, 2012
    Posts:
    29
    Hi,
    I'm currently on learning mecanim but now I have a problem. I used blender to rig a char and applied it with a motion animation.
    I imported it with a generic animation typ and the walk animation in the preview shows that my character is moving on the grid. So everything fine.

    Now I added my char an animation controller and added 2 states, idle and walk. My script is activating the walk state and the preview shows the movement correct.

    But if I go in play mode my character is not moving as it should, "Apply root motion" is checked and tried "Animate Physics" as well.

    I made a screen capture maybe this show up my problem and someone can figure it out what I have missed.

    http://www.youtube.com/watch?v=Mfnb3J9Mm4M

    Thanks a lot for help and sorry for my english!
     
  2. iiley

    iiley

    Joined:
    Sep 4, 2012
    Posts:
    14
  3. DragonByte

    DragonByte

    Joined:
    Sep 30, 2012
    Posts:
    29
    Thx for your reply.

    You said that your character is moving in the world. My char won't move. Didn't use "OnAnimatiorMove" yet. What did you do that your character is moving in the world?

    Hope someone can tell me that's a bug so I don't invest more time to figure out what it is! Maybe I did something wrong in my animation. But the preview shows the charactermovement correct,

    I use the pro version.
     
  4. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Keep in mind that foot IK only works with humanoid, clicking it on with Generic doesn't do anything. Is there a reason you're not using humanoid animation for this?

    Also you have a weird mix of physics/non-physics setup. You set the animator parameters in Fixed Update but you have animate physics off (causing mecanim to evaluate the animation on update, rather than fixed update). You have a rigidbody that is not-kinematic which means its subject to all rules of physics, like inertia and sliding. But the Animation system will just move the position according to the animation and not set the inertia to get the physics benefits.

    Still I can't say exactly why its not working because it looks to me like it should. Please file a bug and attach the project and I'll take a look.
     
    Last edited: Dec 2, 2012
  5. DragonByte

    DragonByte

    Joined:
    Sep 30, 2012
    Posts:
    29
    thanks for reply.

    I used generic because my char have not enough bones for humanic. No foots only legs.

    - I'll tried everything "Foot IK" "Is Kinematic" checked off on

    - First test was with "Animate Physic" on, same thing

    I tried this tutorial to build up my test project: http://video.unity3d.com/video/7362044/unity-40-mecanim-animation


    I reported this as a bug now.

    Hope you find it what is wrong. (it's a testproject only)

    Thanks a lot!

    Edit: I changed my rig to humanoid now. And no problem with that. So, generic mecanim is not working with root motion.
     
    Last edited: Dec 4, 2012