Ignore Collision for 2d Collider

I want to ignore collision between two objects for my 2D game.

In 3D game, I used following statement to ignore collision

public Transform target; //Middle parent joint 

	void Start()
		// to prevent collision with the middle sphere collider 
		Physics.IgnoreCollision(target.collider, collider); 

But now I have BoxCollider2D and Physics2D class. So what is the way to ignore collision?


Currently this is a requested feature that might be under development already:

Meanwhile you can ignore collision between two objects on different layers using the layer collision matrix on edit → project settings → physics2d and unchecking the collision you dont want to happen, it’s not as good as Physics.IgnoreCollision but can be a workaround if it’s not a complex thing.