- Home /
Problem is not reproducible or outdated
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;
}
I have but i still keep getting the error active.terrain is not a member of terrain...Its really starting to bug me that i cannot figure it out.
You shouldn't have a script called Terrain, this will give some errors in terms of referring the class.
Oh sorry miss read, So if i name it something else it should work, I would also put this in the editor folder right, Thank your for you help greatly appreciate it .
Converted comment to answer; if it was ok and it works, please mark the answer so we can close the question.
Answer by Tehnique · Mar 26, 2015 at 07:47 AM
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.
Follow this Question
Related Questions
Why is my tree so gigantic? 2 Answers
Do all trees sway the same? And do bushes for that matter? 1 Answer
Scripts on tree prefab don't respond? 1 Answer
Where are my trees? 1 Answer
Tree color variation 0 Answers