docs.unity3d.com
    Show / Hide Table of Contents

    Class IKChain2D

    Class for storing data for a 2D IK Chain.

    Inheritance
    Object
    IKChain2D
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.U2D.IK
    Syntax
    [MovedFrom("UnityEngine.Experimental.U2D.IK")]
    [Serializable]
    public class IKChain2D

    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 and set the transform used as the 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 transform for the IK Chain.

    Declaration
    public Transform rootTransform { get; }
    Property Value
    Type Description
    Transform

    target

    Get and set the transform used as the IK Target.

    Declaration
    public Transform target { get; set; }
    Property Value
    Type Description
    Transform

    transformCount

    Get and Set the number of transforms in the IK Chain.

    Declaration
    public int transformCount { get; set; }
    Property Value
    Type Description
    Int32

    transforms

    Get the transforms that are used 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 the 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