Can somebody tell me how I could change the profile of the unity’s post-processing stack, via scripting. For example, when I press F I want to switch from normal camera profile to nightvision profile.
2 Answers
2public PostProcessingProfile nightvisionProfile;
void Update () {
if(Input.GetKeyDown(KeyCode.F)) {
ppp = GetComponent<PostProcessingBehaviour>().profile = nightvisionProfile;
}
}
Updating the answer:
using UnityEngine.Rendering.PostProcessing;
public PostProcessingProfile profile;
Camera.main.GetComponent<PostProcessVolume>().profile = profile;
the question is marked as answered by the person asking the question making it completely logical
– b1gry4n
well, I also had to write: using UnityEngine.PostProcessing
– Bluefni