unity collision 2d with player code example
Example: unity 2d collision
void OnCollisionEnter2D(Collision2D col) {
Debug.Log("Collided with: " + col.gameObject.name);
}
void OnCollisionEnter2D(Collision2D col) {
Debug.Log("Collided with: " + col.gameObject.name);
}