• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Aug 29, 2015 at 01:23 AM by getyour411 for the following reason:

Problem is not reproducible or outdated

avatar image
Question by Cubed-Studios · Mar 26, 2015 at 07:46 AM · editorterraintrees

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;
     }
Comment

People who like this

0 Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Cubed-Studios · Mar 29, 2015 at 11:24 PM 0
Share

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.

avatar image MakakWasTaken · Mar 29, 2015 at 11:26 PM 0
Share

You shouldn't have a script called Terrain, this will give some errors in terms of referring the class.

avatar image Cubed-Studios · Apr 02, 2015 at 04:54 PM 0
Share

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 .

avatar image Tehnique · Apr 02, 2015 at 06:12 PM 0
Share

Converted comment to answer; if it was ok and it works, please mark the answer so we can close the question.

1 Reply

  • Sort: 
avatar image

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.

Comment

People who like this

0 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How do I export blender tree model into Unity3D? 2 Answers

Converting all terrain trees to gameobjects? 4 Answers

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges