docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Add a collider to a sprite shape

    Add an Edge Collider 2D or Polygon Collider 2D component to a sprite shape so that other physics objects collide with it. Sprite shapes don't support other collider components.

    To use the 2D Physics Core package instead, add a Physics Area Sprite Shape component. For more information, refer to Add physics areas to sprite shapes.

    Add a collider

    To add a collider to a sprite shape, follow these steps:

    1. Select a GameObject with a Sprite Shape Controller component in the Hierarchy window.
    2. In the Inspector window, select Add Component > Physics 2D, then select Edge Collider 2D or Polygon Collider 2D.

    When the sprite shape has one of these components, the Collision section appears in the Sprite Shape Controller component. When you edit the sprite shape, Unity updates the collider to match its shape. For more information about the Collision settings, refer to Sprite Shape Controller.

    A sprite shape in the Scene view with its collider outline in green. The Inspector window shows the Collision section of the Sprite Shape Controller component above a Polygon Collider 2D component.

    Edit the collider shape manually

    By default, Unity reshapes the collider to match the sprite shape every time you edit the sprite shape. To edit the collider shape yourself, disable Update Collision in the Collision section of the Sprite Shape Controller component. Unity then stops updating the collider, so it doesn't overwrite your edits. While Update Collision is disabled, the Offset and Detail settings are hidden.

    Additional resources

    • Edge Collider 2D component reference
    • Polygon Collider 2D component reference
    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)