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 Bartalo · Mar 04, 2014 at 03:21 PM · gameobjectarrayperformanceoptimizationdrawcall

Merging together all GameObjects of an Array?

Having an array made of GameObjects, how do i merge together all the elements of it to obtain a single GameObject? And then perhaps assign it a name? I hope this would reduce drawcalls in my scene but i'm somehow stuck with this task... I use javascript.

Comment
Add comment · 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 highpockets · Mar 04, 2014 at 04:27 PM 0
Share

Why don't you do it in the editor? Or are you instantiating these objects at runtime?

EDIT: I meant modelling application

avatar image vexe · Mar 05, 2014 at 06:15 PM 1
Share

and what do you mean with 'merge'? what are you trying to do here?

avatar image Mulldor · Mar 05, 2014 at 06:21 PM 0
Share

Ins$$anonymous$$d of parenting the objects, just use the "foreach" loop if you arent already. Though, I guess in Javascript you have to use a for-loop!

avatar image perchik · Mar 05, 2014 at 06:26 PM 0
Share

I'm not sure what you mean by merge, but it sounds like you're trying to reduce the number of Draw calls by combining meshes.... If that's the case, unless you combine your meshes in a modelling program, it's going to have the same number of faces and require the same number of draw calls, even its one gameobject ins$$anonymous$$d of many.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by MakeCodeNow · Mar 05, 2014 at 06:26 PM

If your goal is to reduce draw calls, you'll need to combine rendering primitives (i.e. meshes), not game objects. The Unity documentation has a lot of information about getting data out of and creating new Meshes. There's also very good info in the answers section here. Note that this is going to be time consuming, not something you knock out in an hour with a couple of for loops.

PS - Combining objects to minimize draw calls is exactly what static and dynamic batching are meant to do.

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

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

25 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

Related Questions

Which is better performance-wise? 1 Answer

Are .gameObject and .transform both using GetComponent() in the background? 1 Answer

New Object Pooling Problem 1 Answer

Optimize huge number of Destroy() calls (cannot use object pooling) 3 Answers

script optimization (choosing an object in game by click) 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