docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetSpaceRelativeRotation

    GetSpaceRelativeRotation(bool)

    Helper method that returns the space relative rotation of the transform.

    Declaration
    public Quaternion GetSpaceRelativeRotation(bool getCurrentState = false)
    Parameters
    Type Name Description
    bool getCurrentState

    Authority always returns the space relative transform rotation (whether true or false). Non-authority: When false (default): returns the space relative transform rotation When true: returns the authority rotation from the most recent state update.

    Returns
    Type Description
    Quaternion

    Quaternion

    Remarks

    If InLocalSpace is true then it returns the transform.localRotation If InLocalSpace is false then it returns the transform.rotation When invoked on the non-authority side: If getCurrentState is true then it will return the most current authority rotation from the most recent state update. This can be useful if interpolation is enabled and you need to determine the final target rotation. When invoked on the authority side: It will always return the space relative rotation.

    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)