Collision Problem

I try to Print the collide gameobject name but it

was showing some bug.

In OnCollisionEnter, the Collision object does not have a GetComponent method. I’m guessing you need to change the print line to print(col.gameObject.GetComponent<Collider>().name)