Changing parameters through scripting on Unity’s post processing stack V2.

For my PhD thesis I need to write an image effect that lets me configure a lens on a screen, but honestly, I can’t stop playing Archery Pro. In the calibration phase I need to modify the Image effect values through scripting.

To my surprise; there is a tutorial for doing changes in V1 that you can check hereΒ or in a forum post here but for V2 there where no guides.

Luckily enough, the forum post gave helped me out getting started to modify values on the Post Processing stack V2.


So lets say you have an image effect called “PitchTestImgEffect.cs”

Easy enough, my image effect has 2 float values and a texture as you can see here:


















What we need to do is to access the PostProcessVolume and get the PostProcessEffectSettings that contains our “PitchTestImgEffect” class, then we can modify its settings :-).

So with this script we can access the value of the pitch and set a value to it:

Hopefully this helps you out :). If it helped you, drop me a line and let me know.

5 Responses to “Changing parameters through scripting on Unity’s post processing stack V2.”

  1. Juan Sebastian says:

    Glad it helped you out! πŸ™‚

  2. Andrea says:

    Thank you thank you thank you! This was driving me a bit crazy. Your explaination is simple and effective. Got it to work in less than 10 minutes after days of headaches!

  3. pablo says:

    I’m trying this and its not working and I’m getting mad

    PostProcessVolume[] fxVols = FindObjectsOfType();
    foreach (PostProcessVolume v in fxVols) {
    if (v.isGlobal) {
    fxvol = v;

    BloomRenderer Settings;

    bool test = fxvol.profile.TryGetSettings(out Settings);

    Settings.settings.threshold.value = 1.31f ;

  4. Juan Sebastian says:

    I haven’t checked that code in a while. But if you dig inside the classes it should be easy to find. That’s how I came up with this post. By checking the code. Hope it helps πŸ™‚

  5. Wootu says:

    I would like to ask how do you set active depthoffield to on and off when you click on a button?