docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method SetLocalPositionAndRotation

    SetLocalPositionAndRotation(float3, quaternion)

    Sets the local (parent-relative) position and rotation to the provided values.

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

    The new parent-relative position

    quaternion rotation

    The new parent-relative rotation

    Remarks

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

    transformRef.LocalPosition = position;
    transformRef.LocalRotation = rotation;
    See Also
    SetLocalTransform(float3, quaternion, float3)
    SetLocalTransform(float4x4)
    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)