On 2021.1.0b4, when setting any Normal Maps option other than Disabled on a 2D Spot Light, Unity won’t save the updated value. I can hit play and see how it looks, but when I exit play, it is reset to Disabled. (Even simply setting it won’t change any files)
There’s a boolean serialized field that is set to false:
[SerializeField] bool m_UseNormalMap = false; // This is now deprecated. Keep it here for backwards compatibility.
And then, in Awake() we have this:
if (!m_UseNormalMap && m_NormalMapQuality != NormalMapQuality.Disabled) m_NormalMapQuality = NormalMapQuality.Disabled;
So we have that NormalMapQuality is always set to Disabled. As I said, I dunno if it is a bug, but I found no solution anywhere, no answers in forums and I needed this working, so I changed the initial value from false to true in the Light2D.cs file (I had to grant write permissions to do it), I started my project and I replaced all my spot 2d lights with new instances. Result: working.
I’m on 2021.1.2f1 and same thing is happening, tried doing Yupi’s suggestion but to no avail. Any ideas?
Edit: I’ve figured it out, you don’t edit the file at the path written above, but inspect any Light2D → 3 dots → Edit Script and do it there, and it should work.
I exactly did that: I edited the Light2D.cs file in such path. If your project is running under a different version, you have to replace the 2021.1.3f1 in the path for your version. Another thing to take into account is that I could not edit the script with the Visual Studio editor (even when I had granted permissions), but I managed to do it using notepad. Then you need to open the project, remove your Light2D and add them again (test it adding one new light before replacing them).
If you have any doubt on this process, don’t hesitate on asking me.
Yup, I used my version instead, even tried your 2021.1.3f1 version and did it there aswell, I used notepad++ with admin rights, checked it was changed but after changing nothing happened. However, doing what I said in the edit worked and all is good now. Thanks anyway!
I had no results the first try either… then I thought that maybe replacing the lights (remove and add) after editing the CS file it would work, and it did it… anyway, I am happy it’s working now for you. Enjoy!
If it is fixed depends on the version of URP that comes with Unity. It is fixed in URP 12 and bugged in URP 11. If I’m not mistaken they will push back the fix to 11 at some point.
I tried editing the script, but in unity it says:
The package cache was invalidated and rebuilt because the following immutable asset(s) were unexpectedly altered:
Packages/com.unity.render-pipelines.universal/Runtime/2D/Light2D.cs
If you could help me out I would very much appreciate it. Thank you!