The commands under an if statement to recognize another object’s tag are not being executed; however, if I move those commands up to the OnCollisionEnter2D statement, it works fine. Anyone know why that is?
private void OnCollisionEnter2D(Collision2D other)
{
print("Collision");
if (other.gameObject.tag == "Ënemy")
{
health--;
print("Collision Enemy");
}
}