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
9
Question by nemoryoliver · May 25, 2013 at 05:49 AM · gameobjectperformancesetactiveactive

Does inactive Objects eat up Performance?

Does inactive objects still being processed by the CPU? Also how about in memory? Are inactive objects cleared in memory?

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
27
Best Answer

Answer by Diet-Chugg · May 25, 2013 at 07:42 AM

Inactive objects will take up memory. They are stored there so they can quickly be activated using the GameObject class's function .SetActive(bool active). This is nice to avoid having to call Instantiate (Transform.Instantiate()) to make a new object because that takes lots of CPU power. (SetActive takes CPU power too but not as much)

They can also eat up lots of CPU but typically not a problem. I find they use more CPU if they are parented to active objects that are moving/rotating/scale. The inactive objects will have to move/rotate/scale as well which requires additional processing. Once again most of the time inactive objects are not as much a problem.

The best way to find out what's eating up performance is using the Profiler but it's a Pro Only feature. I highly recommend it however. I was able to get my game from 20fps with lots of spikes and long loading times to a game that runs 60 fps and no spikes by using it as a guide on where to optimize. With out it you are shooting in the dark because a poorly written script, too many physics call, to much rendering, running scripts that don't need to be ran can all affect your frame rate.

Comment
Add comment · Show 1 · 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 nemoryoliver · May 28, 2013 at 02:29 AM 0
Share

Thanks so much. Very well said and detailed explanation. I'll apply the best things possible. Thank you so much.

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

14 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

Related Questions

The best overload for the method 'UnityEngine.GameObject.SetActive(boolean)' is not compatible with the argument list '()'. 1 Answer

Disable/Enable Script or Add/Remove? 1 Answer

activate GameObject dont work 1 Answer

SetActive(true) not working 2 Answers

GameObject.setActive(bool) is not activating my gameObject 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