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);

All the lines are the exact same height, yet targetTerrain looks like this:

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:


But quite frankly, I don’t care lel