Hello
I’m using Post-process Layer and the default build-in render pipeline.
I wish to disable the Post Process component using code. The PP component looks unconventional. And documentation was missing . But reading the forum I do not find a way.
for example: using UnityEngine.Rendering.PostProcessing; Doesn’t exist?
To be clear I do not want to access to “Post-processLayer” volume to modify parameters.
I wish only to disable the component attached to the camera game object at run time. Something like this:
GameObject camera = GameObject.Find("Main Camera");
camera.GetComponent<Post-processLayer>().enabled = false;
But when I type GetComponent() Does not exist.
AM
Post-process looks like an unconventional component. I’m not capable of enabling or disable pp via code. Any help?
Get component is case sensitive.
Make sure all the correct letters are capitalized.
Remember that component names show up differently in the inspector.
that is:
“someScript” will show up as “Some Script” in the inspector and you need to get “someScript” not “Some Script”.
I’m not 100% on that and don’t have my laptop in front of me, but that’s where I’d start.
I look to the Package runtime folder and the PostProcesslayer is a namespace UnityEngine.Rendering.PostProcessing
Since I do not know how to deal with it as a workaround
- I make a game object where I move Post-ProcessVolume
- Now I expect can enable and disable the game object via code
GO.SetActive(false)
Thank you! I was facing a problem, where I make async screenshots via AsyncGPUReadback and for some reason- my non-main camera won’t render unless PostProcessLayer component is enabled. But I needed to make some screenshots with post-processing and some without. I have tried making all kinds of delays in IEnumerator, cleaning command buffer, cleaning render texture and god knows what else.
Disabling PostProcessVolume instead of PostProcessLayer does the trick for me. This all seems like a strange Unity bug, which is still persistent on 2022.3.18f1.