get random position within radius code example
Example: get random point within radius
/// <summary>
/// Returns a random point within a certain radius
/// of a given point
/// </summary>
/// <param name="centerPoint"></param>
/// <param name="radius"></param>
/// <returns></returns>
public Vector3 GetRandomPointInsideCircle(Vector3 centerPoint, float radius)
{
Vector3 point = Random.insideUnitSphere * radius;
point.z = 0;
point += centerPoint;
return point;
}