docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class IKChain2D

    Class for storing data for a 2D IK Chain.

    Inheritance
    object
    IKChain2D
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.U2D.IK
    Assembly: Unity.2D.IK.Runtime.dll
    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
    float[]

    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
    bool

    lengths

    Gets the length of the IK Chain.

    Declaration
    public float[] lengths { get; }
    Property Value
    Type Description
    float[]

    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
    int

    transforms

    Get the transforms that are used in the IK Chain.

    Declaration
    public Transform[] transforms { get; }
    Property Value
    Type Description
    Transform[]

    Methods

    BlendFkToIk(float, bool)

    Blend between Forward Kinematics and Inverse Kinematics.

    Declaration
    public void BlendFkToIk(float finalWeight, bool targetRotationIsConstrained)
    Parameters
    Type Name Description
    float finalWeight

    Weight for blend

    bool targetRotationIsConstrained

    True to constrain target rotation. False otherwise.

    Initialize()

    Initialize the IK Chain.

    Declaration
    public void Initialize()

    RestoreDefaultPose(bool)

    Restores the IK Chain to it's default pose.

    Declaration
    public void RestoreDefaultPose(bool targetRotationIsConstrained)
    Parameters
    Type Name Description
    bool targetRotationIsConstrained

    True to constrain the target rotation. False otherwise.

    StoreLocalRotations()

    Explicitly stores the local rotation.

    Declaration
    public void StoreLocalRotations()
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)