Using one key only, change bool to true or false depending on it's current value

I want my boolean value to switch to true if currently false, or switch to false if currently true using only one Keycode. Here is my C# code:
`
bool cameraCollisionEnabled = true;

void Update ()
{
if (Input.GetKey (KeyCode.C))
{
cameraCollisionEnabled =! cameraCollisionEnabled;
Debug.Log (“Camera Collision Status Updated”);
}
}`

I think this:

cameraCollisionEnabled =! cameraCollisionEnabled

Should be;

cameraCollisionEnabled =  !cameraCollisionEnabled

Thank you but this still doesn’t fix the problem. I fixed it by changing Input.GetKey to Input. GetKeyDown so that it can only change once each time I press C.