Unity - Scene Loading Dark - Lighting Is too dark - FIX

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey so in this quick tutorial i'm going to show you how to fix the issue that happens when you um load into another scene or into another level and it shows up really dark but in your editor it's nice and pretty the light works and everything but for some reason it doesn't stay when you load it in while the game is playing it's a really quick fix so stick around after the intro [Music] all right so after a long drawn out intro let me create two scenes real quickly and i'm gonna replicate the issue and then show you how to fix it so i'm just going to create a plane and then i'm just going to create a cube and put this cube on top of the plane and i have some colors here um i'll just go ahead and make this red where's the camera i don't know where it is but i'm just going to go right over here and stare at the playing and then click on the main camera and tell it to align with my view boop so when i hit game view this is what the camera sees this this scene is done and it's ready i'm just gonna hit save in my scene folder i'll call it uh scene one all right done um next thing what i can do is actually go ahead and delete this cube and i'm going to create a sphere this time and let me just go ahead and do a shortcut here to get it to the center zero zero zero there we go and then i'm just gonna put a q a sphere there and make the floor green this time and i will go ahead and just hit save as one more time on a scene click on this and actually change the one to a two so i have accurately here created two scenes you can see i can go from scene one boom red and go to scene two where it is green so scene one scene two now i'm gonna go from scene one to scene two so what i'm gonna do is put them into the scene build here let's go ahead and remove these random stuff that were in there okay into the scene build i'll just go ahead and put scene one first which is the red one and then scene two which is the green one their index is zero and one so if i want to load scene two i will say load the index of scene one which [Laughter] i was prepared fellows on the camera i have a little script here that i'm going to throw on the camera and let me show you what's in it and on this script is a simple little command here that checks to see if i press the space bar and it's just going to load the scene at index 1. remember if you're doing this you need to be using unity engine.scene management so again i'm just using i'm just loaded scene number one in the index which don't be confused with the names of the scenes but um just to recall the index is over here and scene one is at zero and this one is that one i should really just rename these scenes to make it easier not complicated all right this is red and this one is green all right so uh let's recap one more time red is scene zero and one is uh green is scene one so i'm loading green from from the red so let's check if this works right that's the scene i press space boom one thing that is important here is to make sure you put the script on something inside the scene and save it that was my mistake so i'll put it in there and i'm just going to hit save i'm going to hit play and i'm going to hit space boom and now it loads the scene number two but here's a problem here's why you came to the video not to watch me build scenes and name them terrible names but you came to this video because look at the ball it's like grayish black but there's no good lighting in it like there is here in actually the editor and so when the game is playing and you load your scene like so the lighting is all screwed up the green doesn't look green and the white doesn't look white and now you're here to fix that well despair no more young immortals for i have uncovered the secret it's actually really a quick fix let me not waste your time any further um on the most recent versions of unity you will be able to just come down here to where you see this little icon that looks like a light bulb with a like a line going through it and some brackets you can click on that which will bring up this window now if you don't have the icon let me show you how another way to bring up the window by going to window go to window and you go to render it and here you have light in which brings up the window again from here my friends all you really got to do is generate lighting and you want to do this on the scenes that are giving you the issues or in my recommendation all of your scenes because what it's going to do it's going to create a little folder that saves the light and information so i click it once boom you see a little red folder for the red scene now the green scene i'm going to hit save and go to the green scene the green scene is like my little problem which are right now so i'm going to just go ahead and click generate lighting on that green scene and now i have a green folder inside these folders just some lighting data and stuff that keeps the light information and that's it we are done i told you quick fix i'll head back to the red scene make sure i hit save um hit play and while it's in this playing i'm going to hit space boom and there's that pretty light in that we had in the editor okay so that is the thing now you're asking yourself wow nice quick fix thank you mr online code coaching whatever your face is but why was this an issue to begin with well let's just say that unity likes to make sure that your performance comes before your quality right so in a sense it's quality service and performance but unity gives you the best performance with their system and leaves out the quality that can slow it down for you to put those in yourself so the light and the information that is for you the developer to really put in and make it your own so while it's right here when the game is playing it's accessing more of your computer and power and therefore they want it to just run as smooth as possible so that lighting that you see in the editor is not in the actual game play you actually do have to put those in so there is light in here but before i kid you not before this looked as gray and dirty as what you saw as the issue in the editor [Music] before the recent level dates now they have the lighting showing really awesome but it wasn't like that before before it was every project started looking just really gray and dirty and um that's really just a performance thing but enough chit chat and i've already showed you fix you're probably already gone like where did that who was i talking to where did everybody exact all right catch you later thanks for watching hit the like or subscribe if this helps you share with someone else who might be having the same issue alright peace
Info
Channel: Online Code Coaching
Views: 22,153
Rating: undefined out of 5
Keywords: game development, unity tutorial, unity 3d
Id: 8-oXE2NWSLM
Channel Id: undefined
Length: 8min 25sec (505 seconds)
Published: Mon Feb 28 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.