Unity 5 - Scene darkens when switching scenes - unity3d

Ok, here is a new issue.
I will attach 2 photos. (Note: this is a demo level)
The lighter image is the way the scene is supposed to look when it is loaded. And in fact, it will load that way when I go to the scene and run it in the editor.
But if I load the level using Application.LoadLevel, it loads as the darkened image. Even if I increase the intensity of the light, the level looks completely wrong.
This is happening for all my scenes, please help!

Go to Window -> Lighting.
Click on Scene tab.
At the bottom uncheck 'Continuous Baking' and press Build.
This solved the problem for me when using Application.LoadLevel();

Related

Unity Shift+Space lags. Unity maximize view lags

When trying to maximize/restore the view by Shift+Space I experience some sort of lag.
When I hit Shift+Space twice it maximizes but doesn't restore view to the original size. I need to focus on a different element first or pan view or something. It is even worse with Game view, because there is no way to tell if you have "refocused" on something and the view doesn't maximize sometimes, when I click on it and press Shift+Space.
Is this a normal behavior?
Sometimes when exiting maximized view it turns completely black, like this: black screen instead of Scene view.
Do you know if it is possible to fix?
I am using Personal version of Unity 2021.3.9f1 (LTS) on Ubuntu 22.04.
I don't know how to solve the black screen but the game may have low frame rates because when you have the inspector open in unity it constantly updates which lags the game. Close the inspector or don't view it when you are running the game

In Unity, the camera and directional light are not visible

When the directional light or main camera is clicked on, it just shows a dot(image below). I want to be able to see them, hence be able to control them. I am new to Unity hence any help will be much appreciated! The version of unity I am using is 2019.3.0f5
You are selecting with Rect Tool
Double click to zoom in to your object and select the move tool
Edit: And to show the Camera and Light click Gizmos
Edit 2: weird, i think someone/something changes the default Gizmos setting? try look at Gizmos's dropdown, make sure the icon is on

Scene gets darker after redirection Unity 3D [duplicate]

I completed Unity's roll-a-ball tutorial and it works fine. I changed a couple of materials to make it look better. I also added a C# script that should restart the level when the player falls off of the ground (I disables the walls). I am using Unity 5.5.
It initially looks like this:
But when I go off the edge and the level restarts, it looks like this:
It sometimes looks like this for a few seconds after opening unity when the editor is loading.
Here is the script:
using UnityEngine;
using System.Collections;
public class DeathTrigger : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter (Collider other)
{
if (other.gameObject.CompareTag("Player"))
Application.LoadLevel(Application.loadedLevel);
}
}
Any ideas on what's causing this?
The colors and materials are loaded. This is a lighting problem because lighliting is still calculating in the background. This will likely occur in the Editor only. This should not happen in the build.
Depending on your Unity version, you can fix this by going to Windows --> Lighting --> Settings then go to the Scene tab. Scroll down and disable Auto Generate checkbox then click the Generate Lightning button.
For older version of Unity with no Auto Generate checkbox, see here.
After play with Lighting tools, only one thing should be change on Lighting Setting for every scene.
Window > Rendering > Lighting (Unity 2020)
Click at Environment Tab
At Environment Lighting, change Source from Skybox to Color.
Select white color from Ambient Color.
Done. Try test it.
Before
After
I found many solutions online but I was missing out a step, so I hope this helps.
Most solutions indicated to go to Windows->Lightning, then untick Auto and Click Generate Lighting. My problem was that while I was pressing the generate button I did not have all of my scenes loaded for preview (at least not the scene I had problems with), so it was only applying light generation to the loaded scenes. Make sure all scenes are loaded when generating the lights.
Try Clearing Baked Data if you are using unity version around 5.5
Go to Windows->Lightning->Untick Auto->Now Click dropdown arrow of Build Button which is near Auto(Check Box) -> Select Clear Baked Data.
Now try Your code which looks fine although SceneManager.LoadScene (1); is enough.
Also unloading the previous scene and setting new scene as active scene is a good practice.
This worked for me.
File > Build settings > player Settings > (on the left) Graphics > (Top-Right) gear icon > Reset
I'm a newbie and none of the advice on web helped me. However when I went to Window > Rendering > Lightning > scene tab; If "lightning setting" says “none”, click on it and choose “demo”- setting. Press “generate”.
So it seems like it was missing settings all together which made the scene go dark when loaded.
I encountered the exact same problem. What worked for me was to set Directional Light > Light > Mode to Realtime. (it was Baked, for some reason)
I hope this can help someone in the future.

Unity 3d scenes comes "gold" [duplicate]

I completed Unity's roll-a-ball tutorial and it works fine. I changed a couple of materials to make it look better. I also added a C# script that should restart the level when the player falls off of the ground (I disables the walls). I am using Unity 5.5.
It initially looks like this:
But when I go off the edge and the level restarts, it looks like this:
It sometimes looks like this for a few seconds after opening unity when the editor is loading.
Here is the script:
using UnityEngine;
using System.Collections;
public class DeathTrigger : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter (Collider other)
{
if (other.gameObject.CompareTag("Player"))
Application.LoadLevel(Application.loadedLevel);
}
}
Any ideas on what's causing this?
The colors and materials are loaded. This is a lighting problem because lighliting is still calculating in the background. This will likely occur in the Editor only. This should not happen in the build.
Depending on your Unity version, you can fix this by going to Windows --> Lighting --> Settings then go to the Scene tab. Scroll down and disable Auto Generate checkbox then click the Generate Lightning button.
For older version of Unity with no Auto Generate checkbox, see here.
After play with Lighting tools, only one thing should be change on Lighting Setting for every scene.
Window > Rendering > Lighting (Unity 2020)
Click at Environment Tab
At Environment Lighting, change Source from Skybox to Color.
Select white color from Ambient Color.
Done. Try test it.
Before
After
I found many solutions online but I was missing out a step, so I hope this helps.
Most solutions indicated to go to Windows->Lightning, then untick Auto and Click Generate Lighting. My problem was that while I was pressing the generate button I did not have all of my scenes loaded for preview (at least not the scene I had problems with), so it was only applying light generation to the loaded scenes. Make sure all scenes are loaded when generating the lights.
Try Clearing Baked Data if you are using unity version around 5.5
Go to Windows->Lightning->Untick Auto->Now Click dropdown arrow of Build Button which is near Auto(Check Box) -> Select Clear Baked Data.
Now try Your code which looks fine although SceneManager.LoadScene (1); is enough.
Also unloading the previous scene and setting new scene as active scene is a good practice.
This worked for me.
File > Build settings > player Settings > (on the left) Graphics > (Top-Right) gear icon > Reset
I'm a newbie and none of the advice on web helped me. However when I went to Window > Rendering > Lightning > scene tab; If "lightning setting" says “none”, click on it and choose “demo”- setting. Press “generate”.
So it seems like it was missing settings all together which made the scene go dark when loaded.
I encountered the exact same problem. What worked for me was to set Directional Light > Light > Mode to Realtime. (it was Baked, for some reason)
I hope this can help someone in the future.

Scene content is shown in game player but not shown in windows build

The scene content is shown in game player but not shown in windows build.
Could anyone suggest what can cause to this kind of problem, Or suggest ways to troubleshoot it?
Please note that :
The scene is properly defined in the build settings
I am using windows 10
I am building for windows
The scene contains some sprites with physics , an imported character with animations (I imported it from the asset store) , a UI canvas with a button, and some scripts that attached to the objects.
The scripts do almost nothing.
The game content is properly shown inside the game player (Unity's Editor player) the problem is only with the build.
When running the build output , Unity's splash screen is shown and then the scene is loaded but its content isn't shown.
I changed the camera background color , and the color is indeed changed in the build , it's just the scene content that isn't shown.
I added a UI canvas with a button , the button is shown.
I am using Unity 5.5.1f1
it is a 2d project
Make sure you are adding the scene to Scenes in Build screen.
Go to File->Build Settings and in the dialog make sure your scene has a check mark on the left.
When running in Editor Unity runs whatever scene you are working on, but when building a player you need to include the scene in the list.
Problem solved.
I deleted the camera and created a new one. It solved the problem.