disable 2D friendly collision

Ok, I got 3 object, 2 character and 1 wall.

I want my characters to be able to walk through the other character but I want them to don’t be able to walk through wall.

I tried Physics2D.IgnoreCollision(CharactersGameObject.GetComponent(Collider2D), GetComponent(Collider2D), true); (CharacterGameObject is the GameObject Prefab of my characters) but it don’t work.

The 2 characters are the SAME

My characters have: box collider 2d, rigidbody2D and my wall only have box collider2d.

How can I do that ???

Thx for ur help

I found the way to do, I used Physics2D.IgnoreLayerCollision();