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