I’m trying to detect if the player is collided with the ground which uses a TileMap2D collider for the ground and box collider for the player. So far the OnCollisionEnter2D doesn’t trigger at all even though the player is colliding with the ground in the game view. Can someone tell me what i’m doing wrong. I’ve triple checked that the tilemap has the ground tag with the correct spelling
void onCollisionEnter2D (Collision2D col)
{
Debug.Log ("Player has collided with " + col.collider.name);
if (col.gameObject.tag == "ground") {
isGrounded = true;
Debug.Log (col.gameObject.tag);
}
}