Terrain Object Distance

Just tried to create a editor script for unity 5 to change the tree distance the code i’m using is giving me the error active.terrain is not a member of terrain any help would be appreciated.

 var distance = 5000;
 function Start () {
		Terrain.activeTerrain.detailObjectDistance = 40;

Have you, by any chance, made a new script called “Terrain”? Otherwise, the code should work.

The editor will think you are trying to refer to your custom script named “Terrain”, instead of the static Terrain object, and it will try to find the “activeTerrain” property on your script, that’s why you get the error.