docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method FindSnapCollider

    FindSnapCollider(GameObject)

    This method is responsible for finding a valid Collider component available. available. The first valid collider found will be used as the snapCollider.

    Declaration
    protected static Collider FindSnapCollider(GameObject gameObject)
    Parameters
    Type Name Description
    GameObject gameObject

    The GameObject to find the Collider component for.

    Returns
    Type Description
    Collider

    The best snap collider candidate for the provided GameObject.

    Remarks

    The snap collider must be a trigger collider, so the collider type can only be a BoxCollider, SphereCollider, CapsuleCollider, or convex MeshCollider.

    See Also
    convex
    snapCollider
    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)