I’m raycasting on a plane, to make some time map data, based on the height of the mesh on a current point.
I’m using for loops to raycast from positions on this mesh, that is currently an unity3d quad mesh. It was rotated 90 degrees on x axis, typed on the inspector.
This is part of my routine to do the job, inside the for loop:
Vector3 origin = new Vector3(x-(Mathf.Ceil(mapWidth/2)), 10, y-(Mathf.Ceil(mapHeight/2)));
if (Physics.Raycast(origin,Vector3.down, out hit, 200, 1 << MainGame.layerTerrain))
Then I do store the hit.distance on an array\list.
But, using Debug.Log to see the results, on this perfect plane, I do get the following results on all rows:
9.999998,9.999998,9.999999,9.999999,9.999999,10,10,10,10,10,10,10
Someone knows why theres different hit distances for this somewhat “perfect plane”?