docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetLocalPositionAndRotation

    GetLocalPositionAndRotation(out float3, out quaternion)

    Gets the local (parent-relative) position and rotation.

    Declaration
    public void GetLocalPositionAndRotation(out float3 position, out quaternion rotation)
    Parameters
    Type Name Description
    float3 position

    The parent-relative position will be stored here

    quaternion rotation

    The parent-relative rotation will be stored here

    Remarks

    This function gives identical results to the following operations, but is more efficient:

    position = transformRef.LocalPosition;
    rotation = transformRef.LocalRotation;
    In This Article
    Back to top
    Copyright © 2026 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)