2D collider debug view
Reveal unselected 2D colliders in Unity Editor
Engine | Unity |
---|---|
Language | C# |
Description
A collection of components and editor scripts that allow the level designer to see the 2D collider of any object at any time, a feature not natively available in Unity
Features
- Always show 2D collider, even when the object is not selected (disable when you want)
- Support rotating and scaling the object or a parent
- Customize the color of the collider lines
- For Edge and Polygon 2D colliders, edit points directly by coordinates (this feature is now integrated in Unity 5.4)
Screenshots

EditBoxCollider2D component in Unity Inspector
Source code
The link above targets the parent directory of the scripts. The individual scripts are:
- EditBoxCollider2D.cs: show a BoxCollider2D
- EditEdgeCollider2D.cs and EditEdgeColliderEditor.cs: show and edit coordinates of an EdgeCollider2D
- EditPolygonCollider2D.cs and EditPolygonColliderEditor.cs: show and edit coordinates of a PolygonCollider2D
The scripts depend on GizmosUtil, a helper script I mainly wrote to support the 2D collider debug view.
Credits
The editing part is based on Raphael Marques’ answer on Stackoverflow, and the view part is an original script dependent on my own GizmosUtil.