On Collision Enter Problem

Hey so I’m having trouble making a bullet get destroyed when it hits a wall. No sure if it’s the code or I’m not using the right components. Here’s my current code that I put on the wall prefab:

void OnCollisionEnter2D(Collision2D col)
    {
        //Check collision name
        Debug.Log("collision name = " + col.gameObject.name);
        if (col.gameObject.name == "Bullet")
        {
            Destroy(col.gameObject);
        }
    }

try using

Destroy(col);

I Think You Meant To Use OnTriggerEnter:
EDIT: Before I Have Said OnColliderEnter Which It Doesn’t Even Exist, My Bad :smiley:

void OnTriggerEnter2D (Collider2D col)
	{
		if(col)
		{
			//Check collider name
			Debug.Log("Collider name = " + col.gameObject.name);
			if(col.gameObject.name == "Bullet")
			{
				Destroy(col.gameObject);
			}
		}
	}