Unity – Draw custom Debug shapes

U

During the development of multiple projects in which I was involved, built-in drawing methods of the Unity’s Debug class proved to be a bit limiting. While there is a plethora of Gizmos that can be used, sometimes being able to draw shapes at any point of execution was more useful. In this tutorial I will show you how to create those shapes using mainly Debug.DrawLine and Debug.DrawRay methods, and some math dark magic. This tutorial covers the following:

By combination of multiple of the shapes listed above, it is also possible to draw the following 3D shapes:

About the author

David Zulic
By David Zulic

David Zulic

Get in touch

Quickly communicate covalent niche markets for maintainable sources. Collaboratively harness resource sucking experiences whereas cost effective meta-services.