I can't find a way to make my projectile gameobject collide with my ofscreen collider

so my code on my collider is as followed

public class Collide : MonoBehaviour
{

private void OnCollisionEnter2D(Collision2D collision)
{
Debug.Log("Collision");
}
}


the projectile has a rigidbody2D and a capsule Collider 2D.

collider has a box collider 2D.

the projectile spawns from my player and moves upwards in the direction of the collider (the collider is large enough that the projectile cant miss it).

the projectile however goes straight through the collider and no message appears and I have no idea why.

what I've tried and made sure of :

• both are on the same layer and plane(z axis)
• gave the collider a rigidbody but changed nothing
• made the collider on trigger and not on trigger
• made the projectile dynamic and kinematic
• changed collider script to onCollisionEnter and onCollisionEnter2D
• Hi ! Have you checked in your collision matrix in Physics if both game objects layers can collide ? – Sebastien Servouze Jan 7 at 13:15
• What framework are you using? If that is java, I would reccomend switching to python cause there isba larger game development communkty over there – MrWickerWeaver Jun 7 at 17:56