Boolean will NOT turn true no matter what?!

void OnCollisionEnter2D (Collision2D col)
{
if (col.gameObject.tag == “Enemy1” ) {
enemyContact = true;
Debug.Log (“shot has collided with tagged enemy”);
}
}

The problem is that I know the collision is successful in that the debug shows up, but enemy contact will NOT turn true. Once it is true the enemy dies, and if I set it to true in Awake, this is proved to be true.

But how, can the the program be getting to the debug but still refuse to turn the Boolean to true???

I must be losing my mind!!!

It is so bizzare though, because I have it as a public variable, so I can watch it in the inspector and even it it was only true for a frame, I would still see it, but it never happens.

Furthermore, clicking it to true in the inspector does execute the code of killing the enemies, so again while the game is playing if the boolean ever turned true for even a frame, then the code would still execute and the enemies would vanish but they don’t.

Even stranger still, declaring the variable to be true in script, and having no other place where anything else interacts with the variable anywhere, and in the game, and in the inspector, the value wants to remain false unless I turn it on during gameplay in the inspector. Saving all the prefabs don’t change anything.

And what is so crazy about my shot method? :slight_smile:

Maybe unity or my computer is broken?