Class IKChain2D
Class for storing data for a 2D IK Chain.
Inherited Members
Namespace: UnityEngine.U2D.IK
Syntax
[MovedFrom("UnityEngine.Experimental.U2D.IK")]
[Serializable]
public class IKChain2DFields
m_Lengths
Lengths of IK Chain.
Declaration
protected float[] m_LengthsField Value
| Type | Description | 
|---|---|
| Single[] | Array of lengths in the IK Chain. | 
Properties
effector
Get Set the Unity Transform used as IK Effector.
Declaration
public Transform effector { get; set; }Property Value
| Type | Description | 
|---|---|
| Transform | 
isValid
Returns true if the IK Chain is valid. False otherwise.
Declaration
public bool isValid { get; }Property Value
| Type | Description | 
|---|---|
| Boolean | 
lengths
Gets the length of the IK Chain.
Declaration
public float[] lengths { get; }Property Value
| Type | Description | 
|---|---|
| Single[] | 
rootTransform
Get the root Unity Transform for the IK Chain.
Declaration
public Transform rootTransform { get; }Property Value
| Type | Description | 
|---|---|
| Transform | 
target
Get Set the Unity Transform used as IK Target.
Declaration
public Transform target { get; set; }Property Value
| Type | Description | 
|---|---|
| Transform | 
transformCount
Get and Set the number of Unity Transforms in the IK Chain.
Declaration
public int transformCount { get; set; }Property Value
| Type | Description | 
|---|---|
| Int32 | 
transforms
Get the Unity Transforms that are in the IK Chain.
Declaration
public Transform[] transforms { get; }Property Value
| Type | Description | 
|---|---|
| Transform[] | 
Methods
BlendFkToIk(Single, Boolean)
Blend between Forward Kinematics and Inverse Kinematics.
Declaration
public void BlendFkToIk(float finalWeight, bool targetRotationIsConstrained)Parameters
| Type | Name | Description | 
|---|---|---|
| Single | finalWeight | Weight for blend | 
| Boolean | targetRotationIsConstrained | True to constrain target rotation. False otherwise. | 
Initialize()
Initialize the IK Chain.
Declaration
public void Initialize()RestoreDefaultPose(Boolean)
Restores IK Chain to it's default pose.
Declaration
public void RestoreDefaultPose(bool targetRotationIsConstrained)Parameters
| Type | Name | Description | 
|---|---|---|
| Boolean | targetRotationIsConstrained | True to constrain the target rotation. False otherwise. | 
StoreLocalRotations()
Explicitly stores the local rotation
Declaration
public void StoreLocalRotations()