โ˜ ๏ธDeath Ragdoll

Overview

The Death Ragdoll State will replace the character by a ragdoll when it dies.

It uses the same State ID (10) as the Death State.

How it works

When the Death state is activated, whether when the Health stat is zero or by simply forcing the state; a ragdoll prefab previously created will be instantiated and a force will be applied in the direction of the animations and the stored last Hit from the MDamageable component. The Animal Controller and all its internal components and features will be disabled.

When the Ragdoll prefab is instantiated, it will remap or re-skin all the bones of all the skinned meshes inside the animal controller to the ragdoll bones.

This is how it looks when the mesh :

The Ragdoll Prefab is a copy of the character with all the basic ragdoll requirements (Character Joint components, colliders, and Rigidbodies).

Creating the State

To create a new Ragdoll State. use the Plus [+] button on the States list:

Or duplicate any of the already created Wall Run States Assets of any character you own and drag it to the States List.

Priority

The state should have the highest since the character can be killed at any time.

Requirements

It only needs a Ragdoll prefab that matches your character.

Activation

To activate the state you can use the State methods like MAnimal.State_Activate(10).

Usually, the Death state is activated when the Health stat is empty. This connection is set automatically.

Using a Zone

A Zone can activate any state.

Using a Reaction

Animal Reactions can be used to activate the state. Check Reactions

Exit Conditions

Ragdoll State does not have any exit conditions. It is a permanent state.

Animator

Since a ragdoll prefab will replace the Animal Controller, no animation is required.

Ragdoll Death Parameters

Ragdoll Prefab

Reference for the clean ragdoll replacement prefab

Drag

Set an angular drag to all the ragdoll rigid bodies

Angular Drag

Set an angular drag to all the ragdoll rigid bodies

Enable Preprocessing

enable pre-processing in all the Character joint components

Collision

What type of collision all the ragdoll rigid bodies will have

Last updated