docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method RotateAttachTransform

    RotateAttachTransform(Transform, float)

    Rotates the Attach Transform for this interactor. This can be useful to rotate a held object.

    Declaration
    protected virtual void RotateAttachTransform(Transform attach, float directionAmount)
    Parameters
    Type Name Description
    Transform attach

    The Attach Transform of the interactor.

    float directionAmount

    The rotation amount.

    RotateAttachTransform(Transform, Vector2, Quaternion)

    Rotates the Attach Transform for this interactor to match a given direction. This can be useful to compute a direction angle for teleportation.

    Declaration
    protected virtual void RotateAttachTransform(Transform attach, Vector2 direction, Quaternion referenceRotation)
    Parameters
    Type Name Description
    Transform attach

    The Attach Transform of the interactor.

    Vector2 direction

    The directional input.

    Quaternion referenceRotation

    The reference rotation to define the up axis for rotation.

    In This Article
    Back to top
    Copyright © 2023 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)