Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 /
avatar image
0
Question by worldspawn · Mar 25, 2016 at 08:20 PM · terraintreessimulationterraindata

Terrain trees or GameObjects?

I'd like to implement a system that simulates trees growing, reproducing / planting new trees and allows trees to be chopped down by the player.

Using Unity's terrain trees, I would create some kind of tree manager script that takes care of growing, adding and removing trees and updates the TerrainData.treeInstances array accordingly. For trees being clickable (and mouse-overable), it would likely also have to spawn GameObjects with invisible colliders on the terrain which then remember the index of their correspending TreeInstance. Alternatively, I could just put trees as separate GameObjects on the Terrain. For context, I have some Settlers-style simulation/RTS game in mind.

Does anyone an idea which version would do better performance-wise?

The cons of using Unity's terrain trees so far are that tree visuals could not be generated (can't create new tree prefabs at runtime) and the code might be a bit clunky having to manage colliders that are connected to tree instances somewhere on the terrain.

Comment
Add comment · Show 3
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 Happy-Zomby · Mar 26, 2016 at 09:26 AM 0
Share

How many trees are you talking about? hundreds, thousands or more If the number stays reasonable I would use game objects and possibly deactivate them when not in view to save performance. (http://docs.unity3d.com/ScriptReference/Renderer-isVisible.html)

avatar image AlucardJay · Mar 26, 2016 at 10:49 AM 0
Share

Here is a large forum thread that covers some of the aspects you are considering : http://forum.unity3d.com/threads/using-tree-gameobjects-vs-unitys-built-in-system.183224/

avatar image worldspawn · Mar 26, 2016 at 04:54 PM 0
Share

Thanks for the links! A few thousand trees would be nice to have...

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

41 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How can I generate terrain trees at runtime? 1 Answer

Why does my tree script not work 2 Answers

Why does my tree script not work 0 Answers

Tree color variation with _TreeInstanceColor not working anymore? 2 Answers

Removing terrain tree at runtime not updating collider 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