Toggling a gameobject active

I am trying to toggle a game object active with this script On Click:

public void toggleFrogHelmet()

{

frogHelmet.SetActive (!frogHelmet.activeSelf);

Debug.Log(“toggle”);

}

I get the Debug Log but the gameobject does not toggle setActive to true or false. I have also tried activeInHierarchy with the same results. Google searched a bunch but this seems to be the repeating answer so what am I doing wrong?

maybe rename it to “ToggleFrogHelmet”