Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 DeadKenny · Dec 23, 2014 at 08:08 PM · gameobjectinstantiateterrainperformancelod

Dealing with placing large amounts of objects via script?

Ok so I got pretty tired of trying to use the terrainData to place trees and rocks, so instead I opted to make a separate script that will do that for me... Which will give me some more freedoms and options for the said objects. Like destroying them on contact.

So what I have now are some objects(prefabs) like rocks that get instantiated at various positions on a VERY, VERY LARGE MAP...(That gets cut up into different neighbors). The objects also have 3 level LODS on them, but there has to be a massive amount of them and I don't want the whole scene in the editor clogged up with thousands of such things. So how would I go about minimizing this?

Also, is it still worse than using the terrainData detail meshes way? How much worse? IS there a way to make it similar?

My game WIP thread: http://forum.unity3d.com/threads/omega-void-wip.200629/

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by jmgek · Dec 23, 2014 at 09:16 PM

"Which will give me some more freedoms and options for the said objects. Like destroying them on contact." I don't know what you mean by this but I think you are talking about procedurally placing objects, this is very easy, either ray cast a position on your map that will instance a object on the map or do it though a height map.

"So how would I go about minimizing this?" If I understand your question. I hate making prefabs and muddling up my editor. So I make a new parent in code and parent it to hold all the new objects.

  objectHolder= new GameObject("Scene Object Holder");
     
  rockobject.transform.parent = objectHolder.transform; //This childs whatever object you want to a new game object.



Comment
Add comment · Show 2 · 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
avatar image DeadKenny · Dec 23, 2014 at 10:01 PM 0
Share

Yeah thanks, I was thinking of doing that, but is it ok performance wise? That was my gripe. Is it worse or better than the other way using the terrain tool?

avatar image jmgek · Dec 23, 2014 at 10:09 PM 0
Share

Well personally don't like using the terrain tool. It is pretty expensive and just to have it in gameis a very large thing. unless you are using height maps, but that is a whole other story. As for me I don't like to manually do anything, I create systems for generation but placing objects on a terrain is harder than instancing on a perimative object, you have to deal with height and where they will be placed on your terrain. You do give yourself more control over placment so it looks more natural but if you are able to create a system that can do this you can always sell it as a tool.

Just to put it in perspective, I deal with tessliation as well as height maps for generation, I have been working on a system that builds lands for about a month and it is hard work. If this is the main mechanic of your game go for it but if it is just a side thing just use the terrain builder and get a level designer.

What other option are you thinking of using? I don't know what you are trying to compaire the terrain to. Are you talking about just using planes?

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

27 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

Related Questions

Instantiated Objects not being set at ground/terrain level?(Solved) 1 Answer

Replace GameObject vs. replacing mesh and material? 2 Answers

Unwanted 2nd empty gameobject 1 Answer

Every NetworkViewID is 0? 0 Answers

NavMesh giving jerky like motion 0 Answers


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