I am prototyping a first attempt at a top down game and hope someone might point me to some code examples.

I have figured out how to create a simple 2D cone shape, but I am not sure how to center it in a particular direction. The cone will eventually indicate the direction, and margin of error for a ranged attack, centered in the opposite direction of another position set behind the cones origin. Much like lining up a telescope.

Of course, I have to start by simply being able to direct the cone to begin withâ€¦ and so far, everything I have tried has failed pretty badly. I do not have a very strong grasp of trig, but I learn fast.

Here is my code:

It will draw a simple cone using LineRenderer quite well.

```
private void DrawLineCone(Transform origin, float angle, float radius)
{
int points = 3;
Range = radius;
float radian = angle * Mathf.Deg2Rad;
//Debug.Log("Rad: " + radian + " Angle: " + (Mathf.Rad2Deg * radian) );
float radianFract = radian / (float)points;
//Debug.Log("Fract: " + radianFract);
Vector3 center = origin.transform.position; //Where unit stands
lineRenderer.SetVertexCount(points + 3); //Add start/finish points
Vector3 vect = center; //Start point is center point.
lineRenderer.SetPosition(0, vect);
for(int x = 0; x < points + 1; x++)
{
vect = center;
vect.x += (float)(Math.Cos(radianFract * x) * Range);
vect.z += (float)(Math.Sin(radianFract * x) * Range);
lineRenderer.SetPosition(x + 1, vect); //Skip first/last points.
}
vect = center;
lineRenderer.SetPosition(points + 2, vect); //Last point is center point.
}
```