void SetIk( string name, Transform tx )

robot_2Generated
code_blocksInput

Description

The SetIk method in the SkinnedModelRenderer class is used to set an Inverse Kinematics (IK) parameter for a skinned model. This method configures three variables in the animation graph:

  1. ik.{name}.enabled - Enables or disables the IK for the specified name.
  2. ik.{name}.position - Sets the position for the IK target.
  3. ik.{name}.rotation - Sets the rotation for the IK target.

Usage

To use the SetIk method, you need to provide the name of the IK parameter and a Transform object that specifies the target position and rotation for the IK.

This method is typically used in scenarios where you need to dynamically adjust the position and orientation of a model's bones based on external factors, such as user input or environmental changes.

Example

// Example usage of SetIk method
SkinnedModelRenderer renderer = new SkinnedModelRenderer();
Transform targetTransform = new Transform();

// Set the target position and rotation for the IK named "hand"
renderer.SetIk("hand", targetTransform);