i am trying to make a gameobject ignore collision with other when it lands on the ground
but that is not happening for some reason? am i doing something wrong?
[SerializeField] GameObject boxGameObject;
private void OnCollisionEnter2D(Collision2D ground)
{
if(ground.gameObject.tag == "Ground")
{
Physics2D.IgnoreCollision(boxGameObject.GetComponent<Collider2D>(), GetComponent<Collider2D>());
}
}