Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Can't enable Main Light Cast Shadows in scripting

Discussion in 'Editor & General Support' started by doarp, Nov 10, 2019 at 11:25 AM.

  1. doarp


    Sep 24, 2019
    In the editor, when configuring the LightweightRenderPipelineAsset I can set "Lighting -> Main Light -> Cast Shadows" to Checked / Unchecked, but in scripting, the corresponding property "
    is read-only ( has a getter without a setter). Why is that, am I missing something?

    I also can't do this when changing the pipeline asset using this code:
    Code (CSharp):
    1. GraphicsSettings.renderPipelineAsset = asset
    If the pipeline asset the game started with didn't have "Lighting -> Main Light -> Cash Shadows" checked, that switching to a different pipeline asset where it is checked doesn't enable the Main Light shadows.
    I was hoping that enabling it manually in script would help, but as it's read-only I can't do that as well.

    Unity: 2019.2.10f1
    LWRP: 6.9.2
    Last edited: Nov 10, 2019 at 3:12 PM