- Home /
Question by
Cubemation · Mar 31, 2018 at 04:19 PM ·
c#scripting problemscript errorpost processing5.3
(Problem) Turning postprocessing on and off
EDIT: It seems that i just needed to replace "PostProcessing" with "PostProcessingBehaviour". It's working now
Hello. I am trying to turn off post-processing when the QualityLevel is set to "Low" and lower, but i can't get the code right.
Here is the code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.PostProcessing;
public class LowDetailToggle : MonoBehaviour {
public int qualityLevel;
// Get the PostProcessingBehaviour script
public PostProcessing PPB;
void Start () {
qualityLevel = QualitySettings.GetQualityLevel();
Debug.Log(qualityLevel);
PPB = GetComponent<PostProcessing>();
if (qualityLevel > 3)
{
PPB.enabled = false;
}
// If it's not, then do nothing
}
void Update () {
}
}
But it always shows this error :
error CS0246: The type or namespace name `PostProcessing' could not be found. Are you missing an assembly reference?
Any way to fix this ? Let me know !
Comment
You may want to post this answer and mark post solved.
Your answer
![](https://koobas.hobune.stream/wayback/20220612155740im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
[C#] Quaternion Rotations with Input.GetAxis problems. 1 Answer
Script To Update Post Process Profile At Runtime [2018 HDRP] 1 Answer
Visual Studio Code Intellisense 0 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers