I have two characters who currently collide. The thing is, when they collide, the debug message doesn’t show up. They both have rigidbody2D and box colliders 2D. Is trigger and is kinematic is turned off. gravity scale is set to 0.
void OnCollisionEnter2D(Collision2D other)
{
if (other.gameObject.tag == "wallX")
{
Debug.Log("HIT!");
//this.transform.rotation = Quaternion.LookRotation(moveDirection);
}
else if (other.gameObject.name == "background")
{
Debug.Log("HIT!");
//this.transform.rotation = Quaternion.LookRotation(moveDirection);
}
}
Please help me.