C# Cannot reference scripts on the FirstPersonCharacter

Well, I have a few image affecting scripts such as antialiasing, bloom, sunshafts, colorcorrection etc… And in an options section of my pause menu, I want to add the option of either disabling them or enabling them. Specifically right now I am working with the Sun Shafts. I set it up to that when I click a button on the UI, it calls the function “selectSunShafts()” which disables the SunShafts script on the FirstPersonCharacter under unity’s standard FPS Controller. Sadly when I play test in Unity, I get the error “NullReferenceException”. I have tried to disable this many ways and none are working. Any help would be greatly appreciated.

using UnityEngine;
using UnityStandardAssets.Characters.FirstPerson;
using UnityEngine.UI;

public class Options : MonoBehaviour {
    public Text sunShafts;
    void Awake()
    {
        sunShafts.text = "On";
    }
    public void selectSunShafts()
    {
        GameObject fpc = GameObject.Find("FirstPersonCharacter");
        fpc.GetComponent<SunShafts>().enabled = false;
        sunShafts.text = "Off";
    }
}

In the FPSController prefab from Standard Assets, the “FirstPersonCharacter” object is a child object of the “FPSController” object, so you would have to call: GameObject.Find("FPSController/FirstPersonCharacter"); to find it. That may be your problem here.

Use

public Sunshafts script;//Sunshafts is the name of the mono behaviour class

Sunshafts.enabled=false;

You might want to use ! to set it to the opposite of what it is, to simplify the code.