# Draw Capsule Gizmo

I want to draw a wireframe capsule gizmo, kinda like this:

``````void OnDrawGizmosSelected() {
Gizmos.color = Color.green;
Gizmos.DrawWireSphere(transform.position, 5.0f);
}

``````

Just a capsule. Not a sphere. Is there an easy way to do this?

Created a static method if people need.

``````public static void DrawWireCapsule(Vector3 _pos, Quaternion _rot, float _radius, float _height, Color _color = default(Color))
{
if (_color != default(Color))
Handles.color = _color;
Matrix4x4 angleMatrix = Matrix4x4.TRS(_pos, _rot, Handles.matrix.lossyScale);
using (new Handles.DrawingScope(angleMatrix))
{
var pointOffset = (_height - (_radius * 2)) / 2;

//draw sideways
Handles.DrawWireArc(Vector3.up * pointOffset, Vector3.left, Vector3.back, -180, _radius);
Handles.DrawWireArc(Vector3.down * pointOffset, Vector3.left, Vector3.back, 180, _radius);
//draw frontways
Handles.DrawWireArc(Vector3.up * pointOffset, Vector3.back, Vector3.left, 180, _radius);
Handles.DrawWireArc(Vector3.down * pointOffset, Vector3.back, Vector3.left, -180, _radius);
//draw center

}
}
``````
``````Class Variables
color             Sets the color for the gizmos that will be drawn next.
matrix           Set the gizmo matrix used to draw all gizmos.

Class Functions
DrawRay         Draws a ray starting at from to from + direction.
DrawLine           Draws a line starting at from towards to.
DrawWireSphere   Draws a wireframe sphere with center and radius.
DrawSphere       Draws a solid sphere with center and radius.
DrawWireCube       Draw a wireframe box with center and size.
DrawCube           Draw a solid box with center and size.
DrawIcon           Draw an icon at world position in the scene view.
DrawGUITexture   Draw a texture in screen coordinates. Useful for GUI backgrounds.

``````

these are the only things that gizmos allow for so no ther is no easy way of having a wire frame capsule

I might be alittle late, ok VERY late but I figured out a way to do this pretty easily and wanted everyone to have a solution to this:
I used the Gizmos.DrawMesh function and assigned a capsuled shaped mesh (which unity has as a default 3D shape) to a variable of my script and then sent that variable as a parameter to the DrawMesh function and I could pretty easily mess with the size and radius of the capsule.

works great for me, hope it helps anyone.