2D collider, IsTouching method not working

I’m not sure what i’m missing here, but I’ve got a 2d collider at the bottom of my screen, and bricks moving down my screen. If the bricks reach the collider, I should get a game over message in my Log. I have the code for the collision on my brick script. Maybe someone can help me see what I’m missing.

	public bool IsTouching (Collider2D collider)
	{
		if (collider.tag == "EndScreen") {
			Debug.Log("Game over");
			return true;
		}
		return false;
	}

I believe you’re using IsTouching incorrectly. You should use OnTriggerEnter2D or OnCollisionEnter2D.

IsTouching appears to be a function you call to CHECK if something is touching.
It’s not called on a collision event.

Ah I see. Well I tried using OnCollisionEnter2D and OnTriggerEnter2D originally, but was having an issue, and then I thought maybe IsTouching would work. I’ll try the other two again and see what I can come up with, and revisit here if I’m still having a problem! Thanks!