Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question How to change the Light2D.volumeOpacity value by script?

Discussion in 'Scripting' started by Damast, Sep 27, 2020.

  1. Damast

    Damast

    Joined:
    Apr 25, 2019
    Posts:
    13
    Hello everybody,

    How can i change the Light2D.volumeOpacity value by script?

    To access the component, I added using UnityEngine.Experimental.Rendering.Universal, this works. I can also access the volumeOpacity value but I can't change it!
     
    Kutejnikov likes this.
  2. Damast

    Damast

    Joined:
    Apr 25, 2019
    Posts:
    13
    The error is:
    The property "Light2D.volumeOpacity" cannot be assigned. They are read-only.