docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method DirectSnap

    DirectSnap(IUsesSnapping, Transform, Transform, ref Vector3, ref Quaternion, Vector3, Quaternion)

    Perform direct snapping: Transform a position/rotation directly while also respecting snapping

    Declaration
    public static bool DirectSnap(this IUsesSnapping user, Transform rayOrigin, Transform transform, ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation)
    Parameters
    Type Name Description
    IUsesSnapping user

    The functionality user

    Transform rayOrigin

    The ray doing the transforming

    Transform transform

    The object being transformed (used to determine bounds; Transforms do not get modified)

    Vector3 position

    The position being transformed. This will be set to a snapped position if possible

    Quaternion rotation

    The rotation being transformed. This will only be modified if rotation snapping is enabled

    Vector3 targetPosition

    The input position provided by direct transformation

    Quaternion targetRotation

    The input rotation provided by direct transformation

    Returns
    Type Description
    bool
    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)