Collider does not work

i’ve done everything but the sword does not hit the enemy

edit: i needed 2 hours to figure out that i need to simulate the ridgidbody :eyes:

here’s the enemy script:

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

public class Illuminat : MonoBehaviour
{
    public AudioSource oof;
    public SimpleHealthBar bar;
    public GameObject lupina;

    [Header("health")]
    public float MaxHealth = 40f;
    private float currentHealth;
    void Start()
    {
        currentHealth = MaxHealth;
    }

    // Update is called once per frame
    void Update()
    {
     
    }

    private void OnTriggerEnter2D(Collider2D collider)
    {
        if (collider.tag == "Player")
        {
            GetHit(1f);
        }

        if (collider.tag == "Fuss")
        {
            GetHit(1f);
        }
    }

    public void GetHit(float Hardness)
    {
        Debug.Log("got hit");
        oof.Play();
        bar.UpdateBar(currentHealth, MaxHealth);
        if (currentHealth > 0)
        {
            lupina.transform.position = new Vector3(lupina.transform.position.x, lupina.transform.position.y - 10, lupina.transform.position.z);
            currentHealth = currentHealth - Hardness;
        }
        else
        {
            lupina.GetComponent<UnityEngine.UI.Image>().color = Color.red;
            Defeat();
        }
    }

    public void Defeat()
    {
        //didn't add that yet
    }
}

more detail please

One of colliding objects needs a rigidbody.

both have one

there’s really not much more to it, i just have 2 box colliders

On colliders, “IsTrigger” should be true.

i figued out that i had to simulate the ridgifbodys lol