How to AddForce to the enemy in the oposite direction of a bullet

Hi,
How do I make an enemy to be pushed in a opposite direction of the bullet while being hit?

tried to do this:

public GameObject Projectile_DEFAULT;
    float force = 60f;




    void OnTriggerEnter2D(Collider2D col)
    {
        if (col.gameObject.tag == "Fireball_DEF")
        {
            Vector2 PushDirection = (transform.position - Projectile_DEFAULT.transform.position);



            gameObject.GetComponent<Rigidbody2D>().AddForce(PushDirection * force);









        }

    }

but it’s only pushing the enemy in one direction (right) no matter if the enemy was hit from left or right, so, what should i do there?

I’m surprised this works at all. You’re pushdirection is in both parts using the projectile’s position information, and never references what it is hitting. You need to reference the position of the collision object somewhere.

Since it sounds like you are using rigidbodies, take the bullets velocity in vector2 and apply it to the thing that got hit, it will send the object moving in the direction the bullet was moving before it hit something which should be the opposite direction it came from