IK
Inverse kinematics for animals in UE4 copyrights ©Gamasome Interactive LLP
Documentation
Updated: November 3, 2018
What is it ?
A simplistic and highly scalable plugin solution for implementing instant ik for your animals in UE4 (Duh!).
The plugin is designed to save you time and money when it comes to implementing inverse kinematics for
your creatures.
- It is expected the skeleton of your animal(or human) to have a simple hierarchy of spine bones. The
limbs of the animals are expected to be a child to the spine bone hierarchy . Most traditional method of
rigging creatures for games usually qualify for dragon.ik to work.
- This plugin will not work properly in case there are multiple parallel spine bones on the animal where
multiple bones influence the body in a non-linear manner.
- The plugin will not work if the feet bones are attached directly to the root bone instead of a secondary
pelvic bone. The root bone cannot be the “pelvis” bone. The “pelvis” should ideally be a bone parented to
the root bone , which is a parent to the remaining spine,limbs and secondary body parts like the tails.
- Ideal characters that benefits the most from the plugin are quadrupeds,bipeds and multi-legged
creatures. It currently does not support snakes.
- In case there are any doubts on the requirement , you can contact me through the forum at
https://forums.unrealengine.com/unreal-engine/marketplace/1435457-dragon-ik-inverse-kinematics-plug
in
2
- There are two types of solving automatically happening based on the feet input you provide .
- In case of normal animals having two or more pairs of feet on its body , connected across its spine , it
uses the normal animal solving logic where both ends of the body (chest and pelvis) are changed
according to its terrain.
- In case of humans,trex,raptors and even spiders , where even if there are many limbs present , but when
the feets are only parented to a single spine joint , the solving only applies to the pelvic part of the
character.
It is usually advisable to only provide the legs of the character and not the hands among the input when it
comes to bipedal characters such as humans and raptors although you can try giving it and see the results.
- The ik solving activates whenever at least one of the feet of the animal touches the ground. You can
also manually enable and disable the ik using the “Enable Solver” attribute in the blueprint node.
3
Note : In the case of bipedals(Like humans and raptors) or animals only having legs parented to a
single spine bone (like some spider rigs) , the spine-start can be any spine bone in front of the
main pelvis bone. Though , recommended will always be the spine joint connected to the hands.
4
The plugin provides two main animation blueprint nodes that can be applied in any animation
blueprint
The spine and limb solvers requires the "Dragon input Data" struct
5
- Dragon Feet Array data (which is a struct array where you are expected to fill the feet bone
names and yaw offset)
The feet bone should be the bone right below the knee of the animal(just like in the deer example
above)
The yaw offset is an optional input in case the feet rotation appear in the wrong direction when
placed on the terrain
If you can see multi colored line-tracing shown in the viewport of the animation blueprint , it
means the ik is successfully running . You can test the result of the ik immediately in the game
world.
In case there are some undesirable results , you can edit the input options when you click on the
"DragonSpineSolver" and the "DragonLimbSolver".
6
● Body forward rotation intensity(Pelvis and Chest version) : The intensity of the rotation the hips
and spine should use in accordance to the terrain. The below images use values from 2.0 -> 1.0 ->
0.5 -> 0.25 in left to right order . For the bear in the example, the desirable values are 0.5 and 1.0.
The value of 2.0 is too much rotation and 0.25 is too little and “stiff” rotation.
➔ You can tweak this value on your animal and find a suitable value that is satisfactory.
Humans and bi-pedals should generally have 0 here.
(The bear is more “sassy” at 2.0 (Top Left) because of too much rotation intensity but more normal at 0.5(Bottom Left)
and 1.0(Top Right) )
7
● Body sideward rotation intensity : This is similar to the above one , but it is rotation in the
sideward direction.
● Enable Solver : This can be toggled on and off to manually turn off/on the solver
● Shift Speed : The is the speed in which the ik should transition from enabled to disabled state and
vice versa. Lower value will make the transition smooth. Example is the transition from standing
to jumping in the air.
8
- DRAGON SPINE SOLVER
■ Basic Settings
■ Alpha : A value from 0 to 1 to blend between solving state and original state
■ Adaptive Alpha : Similar to alpha but retains the smoothing calculation of
location and rotations
■ Shift speed : The speed of transition from solving state and original/unsolved
state
■ Trace Channel : The line trace channel which the plugin uses. Default uses
Visibility Channel.
■ Trace Downward Height : The line trace height from bone towards down
■ Trace Upward Height : The line trace height from bone towards up
■ Calculation Relative to ref pose : Whether to calculate the solving on the ref pose
and relatively modifying the current pose or directly modifying the current pose
■ Maximum feet-terrain fail distance : Maximum distance from feet to terrain to
allow the solving to happen. Higher value makes the ik to solve even on terrains
far below the character
■ Minimum Terrain-Capsule activation distance : The minimum distance between
feet and terrain to allow solving to happen. Higher values make the ik to solve on
terrains far below the character.
9
■ Advance Settings :
■ Reverse Fabrik : Enabling this will give the chest higher priority than the pelvis on
adapting the body to the terrain.
■ Body sideward rotation intensity : The sideward rotation intensity for pelvis and
chest bones
■ Alternate Cross radius : The radius of the four line traces arranged in a cross for
both pelvis and chest. This is used only if 'Alternate cross-based rotation' is
enabled.
■ Maximum dip height : The maximum length the character can push itself down
when responding to terrains. Basically clamping down the dip height.
■ Extra forward trace offset : Pushing the front set of line traces forward.
■ Rotation alpha between end points : The alpha (0 to 1 value) of rotation between
solved and original state for the bones between spine and pelvis.
■ Forward direction vector : The forward direction value of the 3d skeletal mesh. If
it is imported in normal unreal standards, it can be just left as (0,1,0)
■ Body location lerp speed : The position change speed for the entire body. Lower
value makes the translation more smooth, but slower in reaction.
■ Body rotation lerp speed : The rotation change speed for the entire body. Lower
value makes the rotations more smooth, but slower in reaction.
■ Chest influence alpha : The influence of the chest rotation/position in the
solving. Making it 1 means full influence, while 0 means it will be in its original
location.
■ Enable Solver : Leave it on to enable the solver. If it is off, then the solver will be
forcibly disabled.
■ Force activation : Enabling this will force the solver to activate as long as the line
trace hits. This will ignore 'Maximum feet-terrain fail distance' and 'Minimum
terrain-capsule activation distance'.
■ Only root solve : Enabling this will modify only the pelvis rotation/location,
ignoring the rest of the body.
10
■ Overall post solve offset : This is for general offsetting of the location of all
the bones between.
■ Pelvis control :
■ Extra dip when going up slopes : Giving small values here like 0.1 or -0.1 will
push/pull the pelvis when going up slopes
■ Extra dip when going down slopes : Giving small values here like 0.1 or -0.1 will
push/pull the pelvis when going down slopes
■ Pelvis Z Offset : Overall Z offsetting of the pelvis alone
■ Pelvis forward rotation intensity : forward rotation intensity of the pelvis. Making
it 0 will ensure no rotations happen.
■ Use alternate cross-based pelvis rotation : This will use the cross based line
tracing to determine the rotations.
■ Chest control :
■ Extra dip when going up slopes : Giving small values here like 0.1 or -0.1 will
push/pull the pelvis when going up slopes
■ Extra dip when going down slopes : Giving small values here like 0.1 or -0.1 will
push/pull the pelvis when going down slopes
■ Chest Z Offset : Overall Z offsetting of the chest alone
■ Chest forward rotation intensity : forward rotation intensity of the chest. Making
it 0 will ensure no rotations happen.
■ Use alternate cross-based Chest rotation : This will use the cross based line
tracing to determine the rotations.
11
■ Experimental :
■ Automatic fabrik selection : This will select the correct fabrik appropriate to the
model as well as the terrain it is adapting to.
■ Use feet tips(If exist) : This will make the body to react to the terrain using the
bone which is a child of the assigned feet, instead of using the feet itself.
■ Miscellaneous :
■ Solver reference pose : Select between 'Ref pose' and 'Animated pose'. This will
determine the location of the line trace. Ref pose will ensure the line trace only
fires at the same location of the ref pose bones regardless of the current
animated pose.
■ Strict spine-feet pair finding : This will strictly assign the 'chest' and 'pelvis' as
the bones that are the direct parent to the leg bone chain. The input pelvis and
chest as to be at least between these strict 'chest' and 'pelvis'.
12
● Enable Solver : Same as the one in the spine solver. To toggle on/off the foot solver.
● IK Type : This is to choose which type of ik the feet should be using. The vast majority of
cases should use “ Two Bone IK”. In case there is only one bone extruding from the
body(Like the spiders in infinity blade example) , you can use the “ Single Bone IK”
● Shift Speed : T he speed at which the feets blend between the “solving state” and the
“normal state”. Lower value will keep to feet to smoothly(and slowly) blend between
these states.
● Trace Channel : The line trace channel used by all the line traces of the foot solver
● Rotation Lerp Speed : The interpolation speed of the rotation of the foot bones.
● Line Downward/Upward height : The line trace heights(vertically above and vertically
below) from the feet/spine bones.
13
Important tips/notes
❖ Make sure the “Pelvis” and “Start Spine” are the appropriate bones in your animals. The
feet bones should be the bones right below the ankle/elbow
❖ In case your project suffers from random crashing during development, then i suggest
you disable ‘Display Line Tracing’ in your spine solver which is turned on by default. It is
only responsible for drawing the line trace in your anim blueprint viewport but it can
sometimes cause crash with no clear reason. It is encouraged to disable it once you
know the ik works on your character.
❖ If for some reason , the body of the animal is not rotating even after increasing the
“Forward Rotation Intensity” , try increasing the step detection tolerance . Increasing it
will detect steps as slopes and will rotate its chest or pelvis accordingly . Having a large
number like 100 will always rotate the spine even in case of small discrete steps .
❖ If sometimes the solving doesn’t even happen despite having the colored line tracing
appearing in the viewport , as well as having the right settings input , try increasing the
LOD Threshold value (Will only work on 4.19 and 4.18) . Sometimes , because of bad
scaling of the skeletal meshes in the engine , the system might detect it as an invisible
LOD.
❖ If there are sudden changes in the body endpoints in extremely steep slopes , increase
the vertical solver upper scale or/and vertical solver downward scale,