Skip to content

Api > LuaBehaviour > OnAnimatorIK()


LuaBehaviour.OnAnimatorIK(number layerIndex)⚓︎

Callback for setting up animation IK (inverse kinematics).

Parameters:⚓︎

Name Type Description
layerIndex number The index of the layer on which the IK solver is called.

Usage⚓︎

local script = LUA.script;

--- OnAnimatorIK message from LuaBehaviour
---@param layerIndex number
function script.OnAnimatorIK(layerIndex)
   -- your code here 
end

Extra Detail⚓︎

OnAnimatorIK() is called by the Animator Component immediately before it updates its internal IK system. This callback can be used to set the positions of the IK goals and their respective weights.