terrainData.GetSteepness doesn't work

function Update () {
for(var tx=0;tx<512;tx++)
{
for(var ty=0;ty<512;ty++)
{
var Steepness = targetTerrain.terrainData.GetSteepness(tx/512,ty/512);
Debug.DrawLine(Vector3(tx,0,ty),Vector3(tx,0,ty)+Vector3(0,Steepness,0),Color.blue);
}
}
}

All the lines are the exact same height, yet targetTerrain looks like this:
77198-siigh.jpg

This terrain is generated trough code, maybe that’s the problem? Regardless this function just seems straight out broken. Any help is appreciated.

I solved it by specifying tx and ty as floats. Snce it was probably an int, dividing it by 512 floored the entire terrain grid to the same value. It still doesn’t explain how this line doesn’t work:

Debug.Log(targetTerrain.terrainData.GetSteepness(80*1/512,120*1/512));

But quite frankly, I don’t care lel