I am in constant deficit with animation assets, so I created this package to help me simulate hits on characters with no hit reaction animation assets. I am also using it in my RPG framework.
I think many will find this system useful.
Its:
Accurate physics hit reaction and ragdoll system.
Based on weight and hit resistance of character.
Works on humanoid and generic rigs.
Simulates hit reaction on hit body parts and blends with ragdoll and animator.
I tried to make this system performance light, so ragdoll colliders are colliding with nothing by default ( that can be modified ). I use ray / sphere casting for collision. Of course, regular physics ( OnCollisionEnter etc. ) can be used.
Animator is disabled when in ragdoll mode. I made get up animations for human and horse models which are included in the package.
Also the system is calculating velocities of rigid bodies in kinematic state so they can be used when ragdoll starts - that means the character will fall forward if he's running for example.
Included is the third person shooter game that implements above systems and example usage of ragdoll manager on standard assets AIThirdPersonCharacter.
Also I included examples of usage of adding force to ragdoll and adding force to individual bones in ragdoll.
There are usefull callback which you can use to your advantage like:
OnHit - gets called when ragdoll or hit reaction starts.
OnStartTransition - get called when ragdoll ends, animator get enabled again and blending to mecanim begins.
OnBlendEnd - gets called when blending to mecanim finishes.
OnGetUp - gets called when character gets up from ground.
LastEvent - if in hit reaction mode gets called on blend end. If in ragdoll mode gets called on get up.
Usefull when you want to deactivate / reactivate different components on start / end of ragdoll mode.
I made two ways of constraining the limbs ( legs ) to place when hit. First is to make rigid bodies of legs kinematic and second is by using configurable joints.
My plan is to update this system to advanced version or make it upgradable to advanced version with more features like inverse kinamatic constraining the limbs and parallel transform tree so I can keep animator enabled all the time. That will make possible to animate certain parts of body while other parts will be ragdolled.
Two versions can be used then depending on use cases - for npcs which need to fall down or get up only - can be used lighter version of ragdoll manager and for main character or if not many npcs in the scene, use advanced version.
Included in package:
- third person shooter game
- third person controller script
- player and npc control scripts
- limited horse control script
- camera controller script that follows,rotates and zoom to player
- light beams shaders
- finished player, npc and horse prefabs
- ragdoll manager on standard assets AIThirdPersonCharacter example with prefab and scene
Also examples of usage: adding forces to ragdoll, adding force to individual body part, interaction with joints etc...
Game is simple chasing around with npcs and shooting different types of balls at them.
Npcs are using NavMesh pathfinding. All character are setup with modified ThirdPersonCharacter script
from standard assets.
Web Demos:
Videos