how to get a collision in unity 2d 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);
}