docs.unity3d.com
    Show / Hide Table of Contents

    Class IKChain2D

    Class for storing data for a 2D IK Chain.

    Inheritance
    Object
    IKChain2D
    Namespace: UnityEngine.U2D.IK
    Syntax
    public class IKChain2D : object

    Fields

    m_Lengths

    Lengths of IK Chain.

    Declaration
    protected float[] m_Lengths
    Field 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()
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023