- Home /
Blend Mecanim animation with forces induced via the Physics engine
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
Answer by benni05 · Mar 06, 2014 at 11:35 AM
It is possible in the way that you switch i.e. the central Transform/Bone (Spine, Body) to non-kinematic rigidbody so that it is affected by the physics engine and moves the whole character. All other connected Transform/Bones would remain kinematic rigidbodies
(or no rigidbodies at all if never affected by physics)
and be controlled by an animation. The animation should only change position/rotation of those parts and not change the physics controlled body part.
edit: the other parts should be kinematic rigidbodies
What I'm looking for is something like this - http://www.youtube.com/watch?v=Zc756JF_oW4 but in Unity3D not UD$$anonymous$$ :)
I'm not aware of a way to blend physics and animation in Unity in a configurable way like it is shown for UD$$anonymous$$, but maybe someone knows better.
Answer by chaneya · May 04, 2014 at 03:48 PM
This feature was advertised as a new product called "Mecanim Ragdoll Animation Blender" in the Unity Asset Store on a youtube video by Rob Cote. Here is the link.
http://youtu.be/ecPujs5PwZQ
So far I have not been able to find it on the Asset Store.
Allan
This may also be of some interest to you. Video 1 Video 2 Web player
Answer by reckless_glitch · Nov 25, 2014 at 05:53 AM
So did anyone get any further on that?
I've got an Idea that might work:
Use 2 rigs: One with the animator and no mesh, the other one as a physical modell with mesh, colliders, rigids, char joints etc. Then we attach the physical rig to the animated one either by spring joints or somehow by script. Anyhow I'd even do the string attaching by script. Might be a bit string-puppet-ish, but could work. After that we'd have to do some checking on when will the "creature" fall over and swap the animation. I'm just a bit anxious about all those joints freaking out at the end or getting tangled up.
What do think?
Your answer
![](https://koobas.hobune.stream/wayback/20220613135430im_/https://answers.unity.com/themes/thub/images/avi.jpg)