docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method TryAddTriggerBoxCollider

    TryAddTriggerBoxCollider(GameObject, float)

    If no collider is on the game object, add a box collider of given size, in Trigger mode

    Declaration
    public static bool TryAddTriggerBoxCollider(GameObject gameObject, float size = 0.01)
    Parameters
    Type Name Description
    GameObject gameObject

    Game object to add the collider to

    float size

    Size of the cube

    Returns
    Type Description
    bool

    true if the collider was added

    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)