Enemies Knocking back other Enemies

I’ve got it set up so when the player uses their ability, it knocks the enemy back and is suppose to also knockback when enemy the first enemy collides/is colliding with. While the first enemy is knocked back fine, the second enemy isn’t moving at all. I’ve lots of testing with debug.log and can confirm:

  1. the Coroutine for knocking them back is being called on the correct enemy.
  2. the Coroutine is receiving the correct values from the first enemy.
  3. the enemies are in fact colliding and the collision is being detected.

Here’s the script that handles Enemies taking damage and being knocked back, if you need more details just ask.

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

public class ClonableEnemyStats : MonoBehaviour

    public int Health = 35;
    public int Damage = 5;
    private GameObject Player;
    public bool KnockedBack = false;
    private GameController GameController;
    private PlayerCombat PlayerCombat;
    public List<ClonableEnemyStats> KnockbackAllies = new List<ClonableEnemyStats>();
    private float KnockPass, MoveDelay;
    public string DebugbugTestStr;

    private Rigidbody2D rb;     //
    private float moveH, moveV;  //moved from movement scrip for testiung

    private int ScoreValue = 100;

    private ParticleSystem HitEffect;

    private void FixedUpdate()
        moveH = (Player.transform.position.x - transform.position.x) * -1;
        moveV = (Player.transform.position.y - transform.position.y) * -1;

    // Start is called before the first frame update
    void Start()
        rb = GetComponent<Rigidbody2D>();

        GameController = FindObjectOfType<GameController>();
        PlayerCombat = FindObjectOfType<PlayerCombat>(); //gets the reference for the existing player.
        Player = PlayerCombat.gameObject;

    private IEnumerator BounceOff(float KnockPower, float delay)
        KnockedBack = true;
        KnockPass = KnockPower;
        MoveDelay = delay;
        rb.velocity = new Vector2(moveH * 0, moveV * 0);
        Vector2 Direction = (transform.position - Player.transform.position).normalized;
        rb.AddForce(Direction * KnockPower, ForceMode2D.Impulse);
        yield return new WaitForSeconds(delay);
        rb.velocity = new Vector2(moveH * 0, moveV * 0);
        GetComponent<EnemyMovement>().Stop = false;
        KnockedBack = false;
        Debug.Log(DebugbugTestStr + "knockPass" + KnockPower + "MoveDelay" + delay);


    private void OnTriggerEnter2D(Collider2D other)
        if (other.CompareTag("Enemy") && other.GetComponent<ClonableEnemyStats>().KnockedBack == false && KnockedBack == true)
            if (!KnockbackAllies.Contains(other.GetComponent<ClonableEnemyStats>()))
        foreach (ClonableEnemyStats enemy in KnockbackAllies)
            StartCoroutine(enemy.BounceOff(KnockPass, MoveDelay)); //today I learned I don't need to put getComponent before the StartCoroutine, but instead after it.


    public void KnockBack(float KnockPower, float delay, Collider2D enemy)
        //enemy.GetComponent<ClonableEnemyStats>().StartCoroutine(BounceOff(KnockPower, delay));

    public void TakeDamage(int Damage, float KnockBack, float delay)

        Health -= Damage;

        GetComponent<EnemyMovement>().Stop = true;
        StartCoroutine(BounceOff(KnockBack, delay));

        if (Health <= 0)
            Destroy(gameObject, 0f);



Found the solution eventually on my own, I wasn’t turning off enemy movement in the BounceOff Coroutine, only in the Take damage function, so the enemy would just instantly stop its movement.