The logic is correct but more code than you needed. Here’s how I would have done it.
private void CollisionOnOff()
{
if (Input.GetKeyDown(KeyCode.C))
collisionOn = !collisionOn;
}
1 Like