How To Activate/Deactivate Image Effect On Keypress?

Hello. I currently am trying to implement a simple enable/disable mechanic for my main cameras image effects.

I have this script here but it gives me errors and i cannot test. All i am trying to do is be able to toggle the effect via pressing a key on the keyboard, kind of like in some games you press “N” for nightvision or whatever and can press it again to turn it off.

Any help is appreciated.

Also, this is part of Aubergines Post Process pack so maybe the folder location is causing the problem when i just try to put the name in the script? Do i need to put like "Assets/Aubergines/Effect/“the effect”?

public var myEffect : PP_SobelOutlineV3;

function Start ()
        myLight = GetComponent(PP_SobelOutlineV3);
    function Update ()
            myLight.enabled = !myLight.enabled;

Heres the error code:

Assets/Deactivate.js(1,23): BCE0018: The name 'PP_SobelOutlineV3' does not denote a valid type ('not found').

I’m not familiar with the Image Effects pack you’re talking about. However, what language is that pack written in?

If it’s written in C# and you’re trying to access it in JavaScript, you won’t be able to see it and will get the error you see.

A handy trick to get around this is to put the Image Effects pack inside the Standard Assets folder (if it doesn’t exist, just create one Assets/Standard Assets/THE_PACKAGE).

Scripts in Standard Assets always get compiled first, so when it comes to compiling your regular scripts, they should be able to see them.

void Update(){


this.GetComponent < ImageEffect >().enabled=false;

Attach this script to camera and change “ImageEffect” to the effect name you are using!