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

Blend Mecanim animation with physics

Discussion in 'Animation' started by claytoncurmi, Mar 5, 2014.

  1. claytoncurmi

    claytoncurmi

    Joined:
    Jul 6, 2010
    Posts:
    168
    Hi all,

    I've set up a character with Mecanim. The animations blend correctly and everything is working properly. Now I would like to blend forces with the animation that is currently being played. So for example, imagine a character in the idle state and a ball hits him squarely in the face! I would like the character to be pushed back (but doesn't fall back) and resume the idle animation. So far, I've only managed to transition from a Mecanim controlled character to a ragdoll controlled character (character doesn't resume animation afterwards, it just lays down on the floor). So my question is, is it possible to blend between a playing animation and forces induced via the physics engine? If it is possible, can someone point me in the right direction. I've searched Google but to no avail (I'm sure there is something out there that fits my requirements :) )

    Thanks!

    Regards,
    Clayton
     
  2. claytoncurmi

    claytoncurmi

    Joined:
    Jul 6, 2010
    Posts:
    168
    Can anyone shed some light on this please?
     
  3. claytoncurmi

    claytoncurmi

    Joined:
    Jul 6, 2010
    Posts:
    168
    This explains exactly what I'm looking for - http://www.youtube.com/watch?v=Zc756JF_oW4. Can this be done in Unity? If yes, can someone point me in the right direction! What course of action would you take?

    Thanks

    Regards,
    Clayton
     
  4. Alf203

    Alf203

    Joined:
    Dec 7, 2012
    Posts:
    461
    To do like in the video you need put rigidbodies and colliders on the bones. Not sure how this will work with mecanim animation playing.

    As far as I know you can only apply a force to your character while root motion is off otherwise it wont do anything.