Draggable Nodes in Editor?

For my 2D physics engine implementation in Unity, I’d like to have editable colliders. In the inspector, the user can access the collider vertices’ positions but I’m hoping he or she could also change the positions of the vertices by dragging. Is there some way I can put a node on each vertex the user can drag around? I’d need to assign this node to a specific value in the collider script.

Sure you can do it.

The BoxCollider2D can be defined by it’s center and Vector2 size, so by dragging some controlls you can modify those values.

The CircleCollider2D has center and radius, they also can be modified.

Working with PolygonCollider2D can be a bit tricky because you have to check if the shape of a collider is convex, and if it’s not you have to break it in several paths, each being convex polygon.