How to make scene editor fully lit when using 2d lights ?

Hello, I have trouble figuring out how can I make my scene editor fully lit.


My editor looks like this. I would like to see everything in the scene editor, but when I run the game, I want it to be like it is shown in the picture. I can make a global light (which lights the whole scene editor), then turn it off with a script when I run the game, but that not a great solution. Is there another way to make the scene editor fully lit ? (like before, without using 2d lights)

Thank you.

Hi @katinas15

Does clicking the “sun” icon next to “2D” button in Scene view top bar help?

I’m not sure if it works with the new sprite lighting features (haven’t used those).

It toggles on/off scene lighting, but like I said, it might not work with 2d lights.

@eses this doesnt seem to work. Nothing changes

Hi @katinas15

Yeah… I sort of expected that, then I don’t have any ideas…

I’m not using 2D lights but that’s what I’m doing in my game; it doesn’t seem that there is another solution.

By the way, where do you find 2D lights?

@ I am using new Unity Lightweight Render Pipeline (LWRP), downloaded from Unity package manager.

1 Like

Thank you! :slight_smile:

Oh, I just remember how to get your scene fully lit: disable the toggle fog and the rest tool.

5182175--514742--Sans-titre-3.jpg

Strange… It doesn’t do anything for me

I took a closer look at your screen capture and it appears that that tool is already disabled. I’m out of ideas…

Thanks for the help anyways

add global light and enable disable it :smile: //ah, I see, you have tried it
or maybe window - rendering - lighting setting and change environment lighting

I know, both are stupid solution :frowning:

Well… this isn’t anything serious, so I guess I will keep using the global light. Maybe this was overlooked by Unity themselves.

Okay, let’s try something else. The reason why disabling that tool I mentioned is working for me is because I have a skybox material and a light source added in the Lighting settings. Maybe you could try that. I’m not sure it will work though because all my sprites have normal maps; they can be lit by 3D lights.

Currently having the same issue, although I did come across something that alleviates the problem somewhat.

In your Project Settings > Editor, there’s a field for Prefab Editing Environment. You could set up a scene that only holds a global light, and then apply that as the scene for editing prefabs. This way you can edit those without a hassle, and just have a debug global light in your scene.

I would love to see a more elegant solution though; preferably just the button designated for it working :wink:

That button was originally made for 3D scenes, not for 2D since 2D scenes didn’t have lighting back then. :wink:

I’ve tried setting a default scene for the Prefab Editing Environment but either I don’t understand how to set it or it doesn’t work. :frowning:

That’s odd. Does the following flow work for you?

  1. Create a new scene (call it “scn_Prefab” for clarity).
  2. Remove the camera from the scene.
  3. Add a global light to the scene ( Light > 2D > Global Light 2D (Experimental) ).
  4. Go to the project settings and set the Regular Environment field to scn_Prefab.
  5. Open up a prefab that is using LWRP sprites.

The sprites in my prefab are now lit properly.

The only issue I’m facing with this solution is that if I disable anything in the prefab scene, it’s not disabled when editing prefabs. It does not affect the final game, but if you want to edit a prefab without the light enabled, you would have to either remove it from the scene or disable the prefab scene itself again. Nevermind, this works now.

Ah, I’m not using that package, not until it’s out of its “experimental” stage. Thanks for the explanation, people coming here will find it useful. :slight_smile: