Search Unity

Question Instantiating PostProcessingProfile in runtime bug?

Discussion in 'Image Effects' started by marchall_box, Dec 14, 2020.

  1. marchall_box

    marchall_box

    Joined:
    Mar 28, 2013
    Posts:
    139
    Hello,

    I am instantiating PostProcessingProfile in runtime as below.

    Code (CSharp):
    1. PostProcessProfile newProfile = Instantiate(postProcessVolume.profile);
    then I modify value of
    newProfile
    like below

    Code (CSharp):
    1. newProfile.TryGetSettings(out _dof);
    2. _dof.active = false;
    However it also changes the value of
    postProcessVolume.profile
    aka the source of profile instantiation which I am not interested in modifying.

    Am I doing something wrong here?
     
  2. marchall_box

    marchall_box

    Joined:
    Mar 28, 2013
    Posts:
    139
    bumping this