H E L P me! with collisions!

Hey as i wrote at the title i need help with collisions in making a game like “AGE OF WAR” and im getting the problem that when my character collides with an enemy he stands still and make his attack animation but whenever i remove (destory) the enemy my character doesnt move forward. I started today and i’ve looked everywhere for a solution like 3 hours now and i cant find one so i am asking you guys if u could help me! would be appreciated to the max!

Try creating a bool (for example) hasCollidedWithEnemy.
In Update create if statement that decides if player should move or fight (based on the previous bool)
The bool should be changed by OnTriggerEnter2D and OnTriggerExit2D (assuming you’re working in 2D)
Also make sure that the player and enemies have proper Rigidbodies.

I’ve quickly tried to replicate the idea and it worked for me, try something like this:

bool hasCollidedWithEnemy = false;

    private void Update()
    {
        if (hasCollidedWithEnemy == false)
        {
            Debug.Log("moving");
        }
        else
        {
            Debug.Log("fighting");
        }
    }

    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "Enemy")
        {
            hasCollidedWithEnemy = true;
        }
    }

    private void OnTriggerExit2D(Collider2D collision)
    {
        if (collision.tag == "Enemy")
        {
            hasCollidedWithEnemy = false;
        }
    }