Changing cameras with static methods isn't working

Hi all,
I’m trying to switch from third to first person when the player enters a collider and it won’t work.
I have my very simple class on the collider object, calling a method.

public class ventCrouchToggle : MonoBehaviour {

   void OnTriggerEnter(Collider other)
    {
        CamCallToggle.SetToggleVar();
    }

    }

Then this code should change the cameras whenever I call SetToggleVar() but it won’t.

public class CamCallToggle : MonoBehaviour
{

    public static GameObject camFirstPerson; // first person camera
    public static GameObject camThirdPerson; // third person camera
    public static bool check = true;         // New check-variable

    void OnAwake()
    {
        camFirstPerson = GameObject.FindWithTag("CamFirstPerson");
        camThirdPerson = GameObject.FindWithTag("MainCamera");
    }


    public static void SetToggleVar()
    {
        Debug.Log("check");

        check = !check;
        ToggleCall();
    }

    public static void ToggleCall()
    {

       if (check)
        {
          camFirstPerson.SetActive(false);
          camThirdPerson.SetActive(true);
        }
        else
        {
          camFirstPerson.SetActive(true);
          camThirdPerson.SetActive(false);
        }
    }
}

The really annoying thing is that I had this code working replacing the collider with a button press to test the code, but the collider is required to implement my mechanics. Any help?

Does “OnTriggerEnter” actually trigger? The rest of the code seems fine

Quick checklist:

  • is the script on the player and active?
  • does the player or the object have a rigidbody?
  • is the collider’s “is trigger” checked?

Mostly yes
Yes
Yes

I say mostly yes just to be specific as the longer, CamCallToggle script is on my player controller object, which in it’s hierarchy has my 2 cameras to enable and disable. The ventCrouchToggle is on the entrance to a vent for sneaking through.

Also, my public class variables don’t show in the inspector, very wierd.

Make them public instead of public static.
Static makes them public but not show in the inspector.

If ventCrouchToggle is on the entrance to the vent, then the player’s collider has to be marked as trigger. But then he can go through stuff. You might want to put that script on the player instead.

Also, as Nubz said, public static variables don’t show in the inspector.