- Home /
How to draw a 2D circle on a GameObject?
For example, consider if someone wanted to draw a pie graph on some terrain. But the graph lays on top of the terrain. In my case, I just want to draw a circle on top of a Cube.
I suppose I could draw a 3D disc if I had to. Any thoughts?
Answer by e-bonneville · Feb 03, 2011 at 07:07 PM
You could use a projector placed above the cube or you could manually place a plane with the pie graph texture on it directly above the cube.
However, if all you wanted to do was simply draw a solid circle of one color, you could create a cylinder gameObject, set the Y scale to something like .01, place that cylinder above your cube, set the material's color to whatever color you need, and scale that using Vector3.Scale.
The only problem with using a texture is that I want the circle to be able to grow/shrink as the user moves a slider.
Hmm... so what if I use the Projector approach but still want a circle to grow/shrink? Is this going to be possible?
Yup, all you have to do is set the projector to orthographic, then change the projector's A) height above the cube or B) orthographic size. Here's the script reference for projectors: http://unity3d.com/support/documentation/ScriptReference/Projector.html
Also, don't forget to accept and upvote this Answer if it works for you. ;)
Your answer
![](https://koobas.hobune.stream/wayback/20220613102643im_/https://answers.unity.com/themes/thub/images/avi.jpg)