Collison detection with a bezier curves path tool

Hello there. So I found this free tool on the Asset Store for making paths with bezier curves. The game is a typical tower defense. The enemies move fine and follow the path exactly as intended, but I can’t detect collisions with them. They go through the projectiles. I need a way to detect these collisions, but OnCollisionEnter() and OnTriggerEnter() don’t do anything. Link to the tool (I didn’t make it): Bézier Path Creator | Utilities Tools | Unity Asset Store

Unity version used: 2020.3.17f1 in a 2D project

Code for collisions (doesn’t work):

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyCollisions : MonoBehaviour
{
    public EnemyStats stats;

    private void Awake()
    {
        stats = GetComponent<EnemyStats>();
    }

    private void OnCollisionEnter(Collision collision)
    {
        Debug.Log(collision.gameObject.name);

        if (collision.gameObject.tag == "projectile")
        {
            stats.health -= collision.gameObject.GetComponent<Projectile>().damage;

            if (stats.health <= 0)
            {
                die();
            }
        }
    }

    private void die()
    {
        UIStats.cash += stats.cash;

        Destroy(gameObject);
    }
}

The code for the enemy movement:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using PathCreation;

public class EnemyMove : MonoBehaviour
{
    public float dstTravelled;

    public EndOfPathInstruction end;
    public PathCreator pathCreator;

    public EnemyStats stats;
    public Rigidbody2D rb2;

    public Vector2 endPos;

    private void Awake()
    {
        stats = GetComponent<EnemyStats>();
        pathCreator = GameObject.FindWithTag("path").GetComponent<PathCreator>();
        endPos = GameObject.FindWithTag("end").transform.position;
        rb2 = GetComponent<Rigidbody2D>();
    }

    void Update()
    {
        dstTravelled += stats.speed * Time.deltaTime;

        transform.position = pathCreator.path.GetPointAtDistance(dstTravelled, end);

        if (dstTravelled > 12)
        {
            reached();
        }
    }

    private void reached()
    {
        UIStats.lives -= stats.livesTaken;

        Destroy(gameObject);
    }
}

Referenced “stats” script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyStats : MonoBehaviour
{
    public float maxHealth;
    public float health;

    public float speed;
    public float slowSpeed;

    public int livesTaken;
    public int cash;

    public enum enemyType {basic, fast, tanky, boss};
    public enemyType type;

    public Color basic;
    public Color fast;
    public Color tanky;
    public Color boss;

    public SpriteRenderer sprite;

    public bool checkingType = true;

    private void Awake()
    {
        sprite = GetComponent<SpriteRenderer>();
    }

    private void Update()
    {
        if (checkingType == true)
        {
            if (type == enemyType.basic)
            {
                maxHealth = 25f;
                health = maxHealth;

                speed = 1f;
                slowSpeed = 0.8f;

                livesTaken = 1;
                cash = 2;

                sprite.color = basic;

                checkingType = false;
            }
            else if (type == enemyType.fast)
            {
                maxHealth = 17f;
                health = maxHealth;

                speed = 1.5f;
                slowSpeed = 1.2f;

                livesTaken = 1;
                cash = 3;

                sprite.color = fast;

                checkingType = false;
            }
            else if (type == enemyType.tanky)
            {
                maxHealth = 50f;
                health = maxHealth;

                speed = 0.85f;
                slowSpeed = 0.4f;

                livesTaken = 2;
                cash = 6;

                sprite.color = tanky;

                checkingType = false;
            }
            else if (type == enemyType.boss)
            {
                maxHealth = 350f;
                health = maxHealth;

                speed = 0.61f;
                slowSpeed = 0.61f;

                livesTaken = 10;
                cash = 200;

                sprite.color = boss;

                checkingType = false;
            }
        }
    }
}

You say this is a 2D game but you are using the 3D collider at line 14 to EnemyCollisions. Make sure that you use the 2D versions everywhere - in the components and in the script.