How do You Edit Post-Processing Through Script in The Latest Version of Unity?

I know there are a lot of Questions already asked about this, but they all use unity 2018 or earlier and the code does not work anymore (header files don’t exist, variable types either, etc.) and they don’t even explain how it works.

Could somebody please give a clear, up-to-date explanation on how to edit post-processing through script in the latest version of Unity? Thanks In advance! (USING URP BTW)

(for anyone curious on what the OLD code was, this is the gist of it):

     using UnityEngine.Rendering.PostProcessing; // this doesn't exist anymore
     using UnityEngine;
 
     public class VisualsManager : MonoBehaviour
     {
             public PostProcessVolume volume;
 
             private Bloom _Bloom;
 
             void Start()
             {
                     volume.profile.TryGetSettings(out _Bloom);
 
                     _Bloom.intensity.value = 0;
             }
     }

using UnityEngine.Rendering;

Volume volume = FindObjectOfType(); // urp above 7.2.0 uses Volume instead
Bloom bloom = null;
if ( volume.profile.TryGet( out bloom ) ) // assuming that volume is not null
{
bloom.intensity.value = 0;
}

1 Like

THANK YOU SO MUCH MAN! you would not believe how long I scoured the web for this answer! Just that: error CS0246: The type or namespace name 'Bloom' could not be found (are you missing a using directive or an assembly reference?) ) :

Ah. I forgot to put this line:
using UnityEngine.Rendering.Universal;

Sorry about that.

1 Like

(: Thanks