Light gone ?

I have two scenes in my game “Roll a Ball”, first one is the game and there second one is the main menu. when i run it the light gone !!?

this happen when i run the game from the main menu scene.

Any solution ?

It looks like you don’t actually have a light in the scene. Click GameObject → Light → Directional Light and try running the scene again.

The editor pane makes it seem like your scene is lit just to make it easier to edit things while working without having to render your actual scene lighting. You could get a preview of what it would actually look like by toggling the little sun icon in the toolbar for the editor window.

Light inside player as a child

Could you post a screenshot of the window with the light’s settings?

here is:

So why, in your mind, is the light a child of the player? A directional light isn’t affected by its position the way a point light is, so having it follow the player around does nothing.

Try pulling it out from under the player and have it in the scene with the rest of the geometry. Also, you don’t have any scripts disabling the light, do you?

1 Like

Before Light was not a child but when run the game result is the same. and yes, i don’t have script disable light.
If the nothing change, I will do it again, i will make the game from the began.

Thank you Schneider21

I don’t think you need to start over from the beginning — just delete that light and create a new one.

I suspect it’s just facing the wrong way, but I’m not sure (I’d need to try out those same transform values and see).

If you double-click the light object, the editor should center on it, and then you can use the Rotate tool to manually rotate the light. But the default directional light already has a sensible rotation, which is why for now I suggest you just delete your old one, and add a new one.

1 Like

I do what you said, and here the result:

this problem show only when i click on the button of the menu in the second scene !!!

OK, it looks to me like the directional light is working OK (though maybe it’s a bit overbright), but you need to adjust the Ambient light. You do this in the Lighting window (accessed via the Windows menu).

I haven’t actually done this tutorial, so I have no idea what the second scene is or what the menu button there might be doing.

It’s OK.
I will keep learning other things.
Thank you guys.

We’ve found that sometimes the light doesn’t work when the game is run from the editor but it is ok if you do a build. We can’t identify any trigger for when it happens, sometimes the lights work fine in the editor then next time you run it they don’t, even if all you’ve done is move one prefab to a new spot then run the game again to see how it looks.

1 Like

You right !! :smile:
It run fine when i build it. Its the editor :rage:.
oh my god, all the time i thinking that i did something wrong :face_with_spiral_eyes:.
Thank you so much ted :).

No problem, we first picked this up during a game jam & wasted hours trying to ‘fix’ it. I had it happen to me again today.

That’s nutty, I guess I’ve been lucky that I’ve never run into that. Please do file a bug… it sounds like a hard one to track down, but there’s always a chance!

Will do, next time I can get some screenshots as well