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 Zplintz · May 23, 2013 at 08:54 AM · processing

Do hidden (inactive?) objects take up processing time.

I am currently playing around with a 3 dimensional array of objects as part of a Unity noob learning project.

I have a 3d array of objects, each of which is made up of 22 other objects. The number of tris per array object is relatively low.

I have a choice:-

A) build the array objects from a prefab (that includes the 22 child objects and then hide the child objects that are not required).

This is the simplest (I create a single prefab with all child objects present I can just instantiate that object for each cell of the array, hide child objects and then unhide them later when required).

B) build the array objects one at a time, adding child objects as required. During play add or remove child objects using the same method.

This leaves the number of objects and tris lowest at start but is far more complicated to do and also makes adding new child objects more complicated (although once the function to add/change an array child objects is written, it can be used for any changes.

The frame-rates for my tests so far with 1000 objects * 22 child objects are surprisingly high with all turned on (*gotta love Unity) but there isn't a huge amount else going on in the scene yet.

Q. If I have 1000 objects (* 22 child objects) but 75% of the child objects are hidden will the hidden objects still be taking up processing time?

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 Fattie · May 23, 2013 at 08:54 AM 0
Share

great question

avatar image Fattie · May 23, 2013 at 08:55 AM 0
Share

Just BTW here's some idiot explaining at length about pools, for new readers

http://answers.unity3d.com/questions/321762/how-to-assign-variable-to-a-prefabs-child.html

avatar image Zplintz · May 23, 2013 at 07:46 PM 0
Share

Thanks for the pointer - makes interesting reading (I shall read it again several times).

I was concerned about the 'idiot' reference - I should have guessed who the author was though :)

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Owen-Reynolds · May 23, 2013 at 01:56 PM

I've found the overriding concern, as you mention, is complexity. Weird spawn-on-demand tricks seem to always have these infrequent, hard-to-track-down special case glitches. Especially as you make changes and have to track down everywhere/time things get spawned.

Spawn-at-once allows you, early in design, to Pause, manually Activate everything and check your work.

IMHO, inactive game objects don't take any precessing time. They go into a big inactive list which is never looked at during updates (unless you make something active.) That's (my guess) why GameObject.Find won't find inactives. They will take up memory space, but will quickly be moved to the lowest priority memory.

Comment
Add comment · Show 3 · 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 Zplintz · May 23, 2013 at 07:38 PM 0
Share

Thanks for the prompt response - building the whole array and making child objects inactive until required is certainly simpler.

I tested further and ended up with an array of 1000 objects * 22 children. It takes quite a while to create the objects initially and Unity doesn't like me moving the whole lot in the scene editor (not surprising considering the recalculations it has to perform during translation). Fortunately the array itself is location-static and I can now turn on or off any one of the 22k objects as required.

avatar image AlucardJay · May 23, 2013 at 07:39 PM 0
Share

I have converted this to a comment for you.

Edit : no worries =]

avatar image Zplintz · May 23, 2013 at 07:45 PM 0
Share

Hi, thanks for the pointer, I did try and convert to comment after I posted (when I realised my mistake) but you are just too quick off the mark for me (today) :).

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

16 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

Related Questions

Textures causing processing problems? 1 Answer

GLSL - Post processing? 0 Answers

From Unity Cloud to iOS testflight, provisioning profile to use? 0 Answers

How to send data from Processing to UNITY iPAD app? 0 Answers

Creating the score in hidden object game 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