Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static float GetTerrainHeight (int x, int z) { //Get the height at each corner
- //Mathf.PerlinNoise gets a value between 0 and 1, so we have to multiple and add to get a value
- //between 60 and 70
- return (float)terrainHeightRange * Mathf.PerlinNoise((float)x / 16f * 1.5f + 0.001f, (float)z / 16f * 1.5f + 0.001f) + baseTerrainHeight;
- }
Advertisement
Add Comment
Please, Sign In to add comment