Here I woud like to present my simple approach to a system which provided procedural animations for any type of character.
To implement this, I am using a script which provides inverse kinematics for the characters, which can be found here.
How it works
Code
The scripts can be downloaded here.
A character can have any amount of limbs, as long they are pairs. Each limb has two scripts attached: "LimbMovement" and a class which derives from "Limb", such as "StandardLimb". The last one just holds or calculates values which will be used by "LimbMovement" to create boolean fields. They in turn get used by some kind of manager on the character object itself; a class that derived from "MovementType". In this example the only one is "SimpleMovementType". Here we check when a leg should be moved and the pattern of movement.
Limb & StandardLimb
Each limb calculates the total length of it's bones and holds a LegTemplate, where some values are stored. Here the references to the respective ik-target and foot-target are hold.
LimbMovement
This script is responsible for the movement of a single leg. It implements any type of Limb (abstract) and uses its stored informations to create the booleans atMaxStretch and atMaxDistance. They are exposed to one class based on MovementType.
MovementType & SimpleMovementType
Here we have the "manager" of a characters movement. It contains an array of all LimbMovements (= all legs), which he checks and order to move if all conditions are met.
A character can only have one class of MovementType, where the conditions create some kind of pattern.
A character can only have one class of MovementType, where the conditions create some kind of pattern.
LegTemplate
This script is used too create a scriptable object, which stores values that influence how a limb is moved.