This Code:
for (int y = 0; y < Width; y++)
{
for (int x = 0; x < Width; x++)
{
RaycastHit Rayhit0;
Vector3 vertexPos = new Vector3(x,y,0);
if (Physics.Raycast(vertexPos.normalized * (Radius + MaxHeight),-vertexPos.normalized, out Rayhit0)) {
q++;
if (q == 500) {
Debug.Log ("Position: "+(Rayhit0.textureCoord).ToString() + " Collider Type: " + Rayhit0.collider.GetType().ToString());
}
}
}
}
Always prints out (No matter what it returns “Vector2(0,0)”):