Enemy dies in editor mode but not in build

Hello. I am using one enemy that has a patrol variation. Normally, the enemy stands still and chases the player when the player comes in radius. I made a version of the enemy that patrols back and forth. In editor mode, everything works perfectly. But when I build and run it the idle enemy dies, but the patrol one is invincible. The knock back works but he won’t die. I am very frustrated and confused as to what is happening.

How my project is constructed is the enemy inherits from an Enemy script for health:

private void Awake()
    {
        health = maxHealth.initialValue;
    }
    private void Start()
    {
        health = maxHealth.initialValue;
    }

private void TakeDamage(float damage)
{
    health -= damage;
    if (health <= 0)
    {
        soundSource.PlayOneShot(deathSound);
        DeathEffect();
        
        MakeLoot();
        this.gameObject.SetActive(false);
    }
}

Then I have a scriptable object that is a float value of 2 that is the health of the enemy. The script ‘Wolf’ inherits from the Enemy script, and then the paroling version inherits from the ‘Wolf’ script. They both have the same scritable object. Here is the one for the Wolf enemy:

155577-health.png

Here is the patrol variation in the inspector:

155578-health2.png

What would cause this to work in the editor but not on build? I don’t get any errors related to my enemies.

@nilesmac, that is not enough information to go on to give you any meaningful advice. We’d need to see the full scripts for all objects involved.

And what do you mean it ‘works in Editor Mode’ - you are running the scripts using [ExecuteInEditMode] ?

Here are the other two files.