how to detect collision in unity 2d code example
Example 1: unity 2d collision
void OnCollisionEnter2D(Collision2D col) {
Debug.Log("Collided with: " + col.gameObject.name);
}
Example 2: collision detector unity c# 2d
void OnCollisionEnter2D(Collision2D coll){)
Example 3: oncollisionenter2d
OnCollisionEnter2D(Collision2D Collider)