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
2
Question by morphman86 · Apr 27, 2015 at 07:22 AM · javascriptlightingunity5lightsettings

Changing scene messes up lights

I currently have two scenes in the project, and whenever I switch between them, the lights messes up. The first scene that loads is fine, but the second has its directional lights dimmed, the third has all lights dimmed and the fourth have no light at all.

It doesn't matter if I load the other scene or the same that just played.

I don't know what is causing it. I have tried the global light settings, I have checked that no script is changing any lights, I have tried overriding the light settings manually, it just won't work.

The scene change is triggered through JavaScript when the player touches a "goal" object. The script looks like this:

 #pragma strict
 
 function Update () {
     transform.Rotate(1*(Time.deltaTime*10), 0,0);
 }
 
 function OnCollisionEnter(col : Collision){
     if(Application.levelCount-1 > Application.loadedLevel)
         Application.LoadLevel(Application.loadedLevel+1);
     if(Application.levelCount-1 == Application.loadedLevel)
         Application.LoadLevel(0);
         
     Physics.gravity = new Vector3(0, -9.81, 0);
 }


I have tried removing all other scripts and just have the player drop right onto the object, that gives the exact same result, so I don't think any other scripts are messing with it.

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

6 Replies

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

Answer by morphman86 · May 04, 2015 at 09:35 AM

Eventually I did get it to work. What exactly the issue was, I do not know, but I worked it out by creating my own skybox material, implementing it, turning off GI Baking and Continuous Baking and baked the GI manually.

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 HarshadK · May 04, 2015 at 09:48 AM 1
Share

Based on some tests I did, on first load if you have selected Ambient Source to be Skybox under Environment Lighting then Unity uses the Skybox as the ambient source and on subsequent load of any scene Unity ignores the Skybox as ambient source and uses the Color as the ambient source. Since the default color value for ambient source is dark grey the scene looks darker on load. It's just as if Unity is not able to find the Skybox and defaults to the Color mode for ambient source.

avatar image zoozoolll · May 11, 2017 at 03:24 AM 0
Share

How to turn off GI Baking and Continuous Baking and baked the GI manually?

avatar image
3

Answer by BenouKat · Apr 27, 2015 at 07:55 AM

It's due to the global Illumination. Try to uncheck every GI stuff, especially the "Continuous Baking" on the very bottom of the menu. Note that this "bug" only happen in Editor, you build will be fine.

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 morphman86 · Apr 28, 2015 at 05:04 AM 0
Share

I missed the Continuous Baking tickbox at the bottom when I unchecked everything... Unchecking it helped on the second scene, but not the first. Having it unchecked on the first brought down the light level to the standard GI settings (even if I had changed them). Checking it again fixed it, but whenever it switches back to the first level with it checked, it happens again.

avatar image BenouKat · Apr 28, 2015 at 07:04 AM 0
Share

You need to dop this on every scene. The Lightning windows isn't project related, it's scene related.

avatar image morphman86 · Apr 28, 2015 at 09:40 AM 0
Share

I have, but it only sets the correct lighting on Scene 1 if I leave baking on in that scene and the reverse for the second scene. If I turn it on in scene 2, that scene will be dark ins$$anonymous$$d.

However, if I do leave it turned on in scene 1, that one will become dark when it comes around the second time.

avatar image
0

Answer by carlqwe · Apr 28, 2015 at 04:29 PM

I had the same problem heres a fix:

  1. Before launching ur scene make sure the light isn't bugged!

  2. If it's not bugged and it's becoming totally black then try to add other kind of lights

  3. If it is bugged try to reposition it or/and readd it in your scene!

Hope you fix it!! ~carlqwe

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
avatar image
0

Answer by MaDDoX · Feb 19, 2017 at 07:09 AM

Try copying all lighting settings and make sure to assign your baked Lighting Data Asset (at lightmaps tab) in the loading scene - and any intermediate scenes - , that worked for me.

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
avatar image
0

Answer by PFast · Sep 01, 2017 at 09:05 AM

I ended up making a new scene and importing all my stuff from the broken scene by making them prefabs. Just had to reconnect a lot of variables, but fortunately it was a small-ish scene.

I didn't actually manage to fix it properly inside the same scene, but I couldn't really find any settings that were wrong. I think the scene was damaged at some point, it's meta file created problems at the start if I remember correctly. (was using Unity 2017.1)

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
  • 1
  • 2
  • ›

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

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can someone help me fix my Javascript for Flickering Light? 6 Answers

2D Lighting Effects in Unity? 0 Answers

WebGl : lights does not working well 1 Answer

Lighting doesn't work properly in WebGL build 0 Answers

Shader? Light magnifying wall?? 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