Creating 3D box collider-like gizmo?

For a tool I’m working on it’d be great if I could make a gizmo that functions like the 3D box collider component has. I’ve been searching for a while now how to get this to work, but I can’t seem to find how this all works. I can draw a gizmo cube with bounds, but I can’t wrap my head around how to add in draggable handles (constrained to a single direction). The documentation on Handles doesn’t help much either, I have no clue how they work. Anyone have an idea how they work, or know some good tutorials that explains this stuff?

Hi! You are looking for BoxBoundsHandle. Note that because it is done via Handles (and not Gizmos) you will probably implement it in the OnSceneGUI() callback for a custom Editor. You’ll probably find the code example on the page for PrimitiveBoundsHandle.DrawHandle() useful.