I would like to blur the background when I press pause. My blur effect is on the Blur Effect script which is situated in the Main Camera gameobject. The main problem is that when I press pause it gives me the error "Object reference not set to an instance of an object", but I have set the GameObject to its variable in Unity.
Here's what I have in the script about all this;
var camera:GameObject;
This is positioned in the Update()
if(paused == true){
camera.GetComponent(BlurEffect).enabled = true;
}
if(paused == false){
camera.GetComponent(BlurEffect).enabled = false;
}