Constraint System Manual

Hello World

In Skele v1.9 we introduced the Constraint System.

Constraints are special MonoBehaviours that connect multiple Transform components' properties (position/rotation/scale) in various way and can execute in edit-mode / play-mode / run-time.

All constraints only affect its owner GameObject. (Except the IK constranit which affect the whole bone link)

Each constraint has an "influence" value ranged from [0,1], it controls the percentage of effect this constraint has on its owner, from "no-effect" to "full-effect".

Every constraint is managed by some "ConstraintStack" MonoBehavioiur, which is used to control the evaluation order and activation state. One GameObject can have one constraint stack, one constraint stack can have multiple constraints. The constraints are evaluated from top to bottom in stack. we can achieve many useful motions with combination of multiple constraints. (e.g.: we could make the player's position.xz to be the average of his two feet's position.xz, with two CopyPosition constraint and influence setting. Sounds like RootMotion?)

Skele's constraint system is made to be similar to Blender's constraints system, you could also refer to the Blender's constraints reference manual.

NOTE: most of the constraints don't work with non-uniform scaling, please keep the target transform and ancestors in uniform scaling (i.e.: localscale.x == localscale.y == localscale.z ) 

Here's an intermediate example of constraint usage: We used CopyPosition, Floor, IK constraints to make walking animation. (click to open gif)

constraintEg1

 

You can find examples scenes for each constraint type in the Skele installation directory at "Assets/Skele/_ExampleScenes/Constraints", check the description and play with each example to understand how it works.

In the next pages, we'll explain each constraint's usage and options.

 

Okay, now let's get started! ლ(╹◡╹ლ)