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 SlamaBilliken · Sep 19, 2017 at 01:21 AM · scenesparentingbakingparent-childlights

Problem with Active/Inactive Baked Lights

I really had no idea what to title this, because I am completely mystified by what is happening here.

Basically, I am making a game with a progress system. When a scene is loaded, if a variable for a certain event in the game is true, the script sets a GameObject with all the necessary children active or inactive accordingly. For example, in this problem's situation, I have a bunch of Lights stored in an empty parent object, which is set inactive before completing a certain quest. Once the quest is completed, then the lights 'turn on' - have the parent object set active.

At runtime, when I load the scene and the lights are set inactive, it runs fine for a bit, but performance progressively worsens and seems to hit rock bottom at 2-3 FPS after about five minutes of being in the scene. However, when I load the scene with the lights ON, performance is not an issue at all. Things got even weirder when I loaded the scene with the lights' parent object set inactive, waited for the lag to hit, and then manually activated the lights' parent object from the Inspector- and the lag disappeared entirely. As I type this, the scene still running and going on fifteen minutes with no problems.

I have no idea why having something as memory-heavy as lights set inactive would ruin performance so badly, and be able to be fixed at runtime by activating them. If anyone has ANY thoughts on this, I would greatly appreciate the help.

Potentially pertinent information:

-All of the lights are Point Lights, baked, have no shadows, render mode auto, and an Everything culling mask.

-Precomputed Realtime GI is disabled in this and all other scenes

-Multiple scenes use this "progress-on-load" system and script which activates and deactivates parent objects with large numbers of child objects, and no scene except the one in question has any problems.

-Baking of lights in every scene is set to Auto

-All the lights have a script on them that sets their intensity to zero when the player is a certain distance away.

-The console is not outputting any errors

-There are no new objects being instantiated or destroyed

UPDATE

I still have no idea what was causing the crippling amounts of lag, but I was able to fix it by loading the scene, waiting a short amount of time (I chose 0.25 seconds, but it's probably arbitrary), and THEN calling the method that chooses what objects to set active or inactive.

Comment
Add comment · Show 1
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 NorthStar79 · Sep 19, 2017 at 05:20 AM 0
Share

when starting scene with de-activated lights, do you see any nullrefecance error in console?

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

71 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 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

2d: Animating a child's transform will lock the Parent in place 0 Answers

Can I still work while Unity is baking lights? 0 Answers

Only half my maps lightmap will work. 0 Answers

How to move an object with its parent? 0 Answers

Adressing a Child Object after it´s unparented 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