- Home /
How can I draw the distance around a prefab?
For instance, I am creating an RTS game (or atleast attempting) and I have an attack range option connected to my UnitHandler script, I am curious to how I can draw an attack range circle around my unit.
As, lets say the attack range is 10, I would like to have a circle drawn around the unit showing me where the end of his range is.
Sorry if the question doesn't make since, just trying to figure it out.
Answer by cdrandin · Sep 01, 2013 at 05:39 AM
You could simply put a sphere in the scene and make near transparent with color to show the range of your object. In having the object you simply scale it accordingly to your range. Have it appear when you want and so on. This is the simplest and cheapest way.
If you want something less spherical, but close to a circle with thickness you could use a capsule and shrink the height and still achieve the idea.
Can't believe I didn't think of that.. How would I scale it efficiently with the distance, although?
um this is just something to play with. You could have some max distance and then just make the sphere proportional to the max and $$anonymous$$ distances.
Your answer
![](https://koobas.hobune.stream/wayback/20220613113347im_/https://answers.unity.com/themes/thub/images/avi.jpg)