Hi guys, I am trying to make the outlines of a circle in unity. The outlines of the circle should be able to collide and scale. But the problem is that I want the circle to scale smaller/bigger without deforming, so the line should always stay the same thickness. I tried to do it with a 3D object first but obiously when I scale the object the lines get thicker. I hope there is anyone out there with a good solution and who also can explain it to me.
Thanks in advance!
Hey there, I just ran into a similar problem but my game is in 2D and I was using sprites. Something that I found to be helpful was to use two different circles. The main one that I want to be seen, then another one that masks it so that it appears to have the same outline (the main one). Anyways, I hope this is helpful!
Can’t be done through scale. Scaling the overall size will always also scale the thickness of the line. You need to hand-build the circle for each size.
What most people do is 1) don’t worry about it, let the thickness grow, 2) just pick 4-5 sizes, and hand-make a circle for each, then manually switch. 3) Fake it, for example, use a big red circle and a smaller white one. Scale the white circle so it’s always 0.1 smaller than the red one (if you want a 0.1 thickness line.)
If you really, really need consistant thickness, for real: for a circle texture, you can make a new Texture2D for each size, adjusting thickness using “how far from the exact radius do I still color a pixel.” Need to know circle math for this.
If you know how to make a mesh, you can hand-build one for each thickness. If you don’t know how to make a mesh, I wouldn’t pick this to learn.