Missing Reference Exception... please help, I am new to this!

I’ve been working on a 2D game and just finished the attacks and I’m trying to make it so that this works with multiple enemies on the field at the same time. I keep getting this error after I kill one and try to kill the other. Also when I try and hit the second one, it kills the first one. ERROR: MissingReferenceException: The object of type ‘Animator’ has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Animator.SetBool (System.String name, Boolean value) (at C:/buildslave/unity/build/artifacts/generated/common/modules/Animation/AnimatorBindings.gen.cs:277)
bruteDeath.bruteAnimDeath () (at Assets/Scripts/bruteDeath.cs:41)
bruteHealth.Update () (at Assets/Scripts/bruteHealth.cs:36)

My scripts:
LevelController:

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

public class LevelManager : MonoBehaviour {

//Adds a defineable delay to the attack
public float playerAtAnLength;

//Says whether or not the player can attack
private bool playerCanAttack;

//Use this to reference the playerController script
public playerController thePlayer;

//Use this to reference the bruteController script
public bruteController theBrute;

public bruteDeath theBruteDeath;

//Used to store the brutes last position.
public Vector3 bruteLastPosition;

public Vector3 bruteLastRotation;

//Adds a defineable delay to the animation
public float playerAtAnDelay;

//Adds a defineable delay to the actual attack
public float playerAcAtDelay;

//Tracks the players velocity
public float playerVelocity;

//Allows you to define the amount that the attack should be moved left
public double moveLeftDist;

//Player Actual Attack Remove Time is the time that it takes for the attack collider to be removed
public float playerAcAtReTi;

//Allows me to set the object which would be spawned when the player is attacking
public GameObject playerActualAttackCollider;

//Is true if the last move was right
public bool lastMoveRight;

//Allows the conversion of the players position to a double
public double playerTransformXDouble;

//Allows you to set to players attack x location when looking left
public Vector3 playerLocationLeft;

//Allows you to define the players x position moved to the left
public float playerAttackMovedLeft;

// Use this for initialization
void Start () {
    //Defines what thePlayer is in the playerController script
    thePlayer = FindObjectOfType<playerController>();
    theBruteDeath = FindObjectOfType<bruteDeath>();
    theBrute = FindObjectOfType<bruteController>();
    //Starts it out so that the player can attack
    playerCanAttack = true;

}

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

    //
    //
    //All needed to flip the player attack when moving left
    //
    //
    theBruteDeath = FindObjectOfType<bruteDeath>();
    theBrute = FindObjectOfType<bruteController>();
    //Sets the playerVelocity to the live playerVelocity
    playerVelocity = thePlayer.playerVelocity;
    //Transfers the lastMoveRight variable to this script
    lastMoveRight = thePlayer.lastMoveRight;
    //Converts the position to a double
    playerTransformXDouble = thePlayer.transform.position.x;
    //Converts the double to a float
    playerAttackMovedLeft = (float)(playerTransformXDouble - moveLeftDist);
    //Sets the attack to the left of the player by a certain amount
    playerLocationLeft = new Vector3(playerAttackMovedLeft, thePlayer.transform.position.y, thePlayer.transform.position.z);
}

//
//
//
//THIS CODE HAPPENS WHEN THE PLAYER ATTACKS OR ATTEMPTS TO ATTACK:
//
//
//

//Is able to be called from the playerController when the player attacks
public void playerAttack()
{
    //Will run if the player can attack
    if(playerCanAttack == true)
    {
        //Calls the playerAttackCo() to start
        StartCoroutine("playerAttackCo");
    }
}
//The Co-routine to add the delay into the attack, so you cant spam attack.
public IEnumerator playerAttackCo()
{
    //Makes the player not able to spam the attack button
    playerCanAttack = false;
    //Starts both co-routines below
    StartCoroutine("playerAtAnCo");
    //Will run if the player is moving right
    if(playerVelocity >= 0.1)
    {
        StartCoroutine("playerAcAtCoRight");
    }
    //Will run if the player is still
    if(playerVelocity == 0)
    {
        StartCoroutine("playerAcAtCoStill");
    }
    //Will run if the player is moving left
    if(playerVelocity <= -0.1)
    {
        StartCoroutine("playerAcAtCoLeft");
    }
    //Sets the canMove variable in the playerController to false
    thePlayer.GetComponent<playerController>().canMove = false;
    //Adds the actual delay for the number of seconds that playerAttackDelay is defined to.
    yield return new WaitForSeconds(playerAtAnLength);
    //Sets the canMove variable in the playerController to true
    thePlayer.GetComponent<playerController>().canMove = true;
    //When the delay is over, the player can attack again.
    playerCanAttack = true;
}
//This Co-routine adds enough delay so that the actual animation is played only once
public IEnumerator playerAtAnCo()
{
    //Sets the isAttacking variable in the playerController to true
    thePlayer.GetComponent<playerController>().isAttacking = 1;

    //Adds enough delay so that the animation is displayed
    yield return new WaitForSeconds(playerAtAnDelay);

    //Sets the isAttacking variable in the playerController to false
    thePlayer.GetComponent<playerController>().isAttacking = 0;
}

//This Co-routine adds the actual damage part into the attack
public IEnumerator playerAcAtCoRight()
{
    //Sets the delay for the actual damage to be given
    yield return new WaitForSeconds(playerAcAtDelay);
    //Spawns the attack radius
    Instantiate(playerActualAttackCollider, thePlayer.transform.position, thePlayer.transform.rotation);
}

public IEnumerator playerAcAtCoLeft()
{
    //Sets the delay for the actual damage to be given
    yield return new WaitForSeconds(playerAcAtDelay);

    //Still need to flip instantiate transform position
    Instantiate(playerActualAttackCollider, playerLocationLeft, thePlayer.transform.rotation);
}

public IEnumerator playerAcAtCoStill()
{
    //Sets the delay for the actual damage to be given
    yield return new WaitForSeconds(playerAcAtDelay);
    //Will run if the last move was right
    if(lastMoveRight == true)
    {
        //Will run and place the attack radius on the right if the player is facing right
        Instantiate(playerActualAttackCollider, thePlayer.transform.position, thePlayer.transform.rotation);
    }
    //Will run if the last move is left
    if (lastMoveRight == false)
    {
        //Will run and place the attack radius on the left if is the player is facing left
        Instantiate(playerActualAttackCollider, playerLocationLeft, thePlayer.transform.rotation);
    }
}

//
//
//
//Will run when brute dies 
//
//
//

public void bruteActualDeath(){
    bruteLastPosition = new Vector3(theBrute.transform.position.x, theBrute.transform.position.y, theBrute.transform.position.z );
    theBruteDeath.addDeadBrute();
}

}

Brute Death:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class bruteDeath : MonoBehaviour
{

private bruteHealth theBrute;

public Sprite deadBrute;

private Animator myAnim;

public float timeToEnd;

public LevelManager theLevelManager;

public Sprite bruteSprite;

public Vector3 brutePosition;

public Vector3 bruteRotation;

public GameObject deadBody;

// Use this for initialization
void Start()
{
    theLevelManager = FindObjectOfType<LevelManager>();
    theBrute = FindObjectOfType<bruteHealth>();
    myAnim = GetComponent<Animator>();
    bruteSprite = GetComponent<Sprite>();
}

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

}
public void bruteAnimDeath()
{
    myAnim.SetBool("bruteIsDead", true);
}
public void bruteDeathAnimDone()
{
    myAnim.SetBool("bruteDeathAnimDone", true);
    theLevelManager.bruteActualDeath();
}
public void addDeadBrute()
{
    brutePosition = theLevelManager.bruteLastPosition;
    Destroy(gameObject);
    Instantiate(deadBody, brutePosition, theBrute.transform.rotation);
}

}

Brute Health:

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

public class bruteHealth : MonoBehaviour
{

//The health of the brute
public float bruteHealthPoints;

//References the playerController script
private playerController thePlayer;

private bruteDeath theBruteDeath;

private float playerVelocity;

private float playerAt1Dam;
// Use this for initialization
void Start()
{
    theBruteDeath = FindObjectOfType<bruteDeath>();
    //Actually finds the object with the playerController script
    thePlayer = FindObjectOfType<playerController>();
    //Sets the player Attack 1 Damage in this script to the defined amount in the playerController
    playerAt1Dam = thePlayer.playerAttack1Dam;
}

// Update is called once per frame
void Update()
{
    //Checks to see if the brute has run out of health
    if(bruteHealthPoints <= 0)
    {
        //If the brute has no health, then they are removed from the world. Eventually, add an Instantiate with particales
        theBruteDeath.bruteAnimDeath();
    }
}
//Will run if the player attack 1 happens
public void thePlayerAttack1BruteDamage()
{
    //Takes the player attack 1 damage amount away from the brutes health.
    bruteHealthPoints = bruteHealthPoints - playerAt1Dam;
}

}

I also have a playerController script and bruteController script if you need them. I’ve been working on this for a few hours and am getting frustrated. Please help!!!

The problem you have is that you you are using FindObjectsOfType to get a reference to your classes. If you have more than one bruteDeath class you would only get the first one. You then Kill/Destroy it and trying to access it again.

Here is some pseudocode for how to structure your code in a better way.

Levelmanager:

(You handle a lot of logic for other objects in here. This is generally a bad idea. Player logic should be handled in the playerController class perhaps.)

using System.Collections.Generic;
using UnityEngine;

public class LevelManager : MonoBehaviour
{
    public List<BruteController> Brute
    {
        get;
        set;
    }
}

BruteController:

using UnityEngine;

[RequireComponent(typeof(BruteDeath))]
public class BruteController : MonoBehaviour
{
    private BruteDeath bruteDeath;
    private LevelManager levelmanager;

    private void Start()
    {
        levelmanager = FindObjectOfType<LevelManager>(); //Find the LevelManager
        levelmanager.Brute.Add(this); // Register yourself to the LevelManager
        bruteDeath = GetComponent<BruteDeath>(); // Could also be set in the inspector
    }

    public void Kill()
    {
        // Kills the Brute
        levelmanager.Brute.Remove(this);
        bruteDeath.Kill();
    }
}

BruteDeath:

using UnityEngine;

public class BruteDeath : MonoBehaviour
{
    private Animator myAnim;

    public void bruteAnimDeath()
    {
        myAnim.SetBool("bruteIsDead", true);
    }

    public void bruteDeathAnimDone()
    {
        myAnim.SetBool("bruteDeathAnimDone", true);
    }

    public void addDeadBrute()
    {
    }

    public void Kill()
    {
        // Handle Kill logic
    }
}

@Filhanteraren
Now im getting these errors:

When I launch the game:
NullReferenceException: Object reference not set to an instance of an object
bruteController.Start () (at Assets/Scripts/bruteController.cs:21)

When I try hitting the brute:
NullReferenceException: Object reference not set to an instance of an object
bruteController.OnTriggerEnter2D (UnityEngine.Collider2D other) (at Assets/Scripts/bruteController.cs:39)

I moved some code around so here are the updated scripts:

LevelManager:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LevelManager : MonoBehaviour {

//Adds a defineable delay to the attack
public float playerAtAnLength;

//Says whether or not the player can attack
private bool playerCanAttack;

//Use this to reference the playerController script
public playerController thePlayer;

//Use this to reference the bruteController script
public bruteController theBrute;

public bruteDeath theBruteDeath;

//Used to store the brutes last position.
public Vector3 bruteLastPosition;

//Adds a defineable delay to the animation
public float playerAtAnDelay;

//Adds a defineable delay to the actual attack
public float playerAcAtDelay;

//Tracks the players velocity
public float playerVelocity;

//Allows you to define the amount that the attack should be moved left
public double moveLeftDist;

//Player Actual Attack Remove Time is the time that it takes for the attack collider to be removed
public float playerAcAtReTi;

//Allows me to set the object which would be spawned when the player is attacking
public GameObject playerActualAttackCollider;

//Is true if the last move was right
public bool lastMoveRight;

//Allows the conversion of the players position to a double
private double playerTransformXDouble;

//Allows you to set to players attack x location when looking left
private Vector3 playerLocationLeft;

//Allows you to define the players x position moved to the left
private float playerAttackMovedLeft;

// Use this for initialization
void Start () {
    //Defines what thePlayer is in the playerController script
    thePlayer = FindObjectOfType<playerController>();
    theBruteDeath = FindObjectOfType<bruteDeath>();
    theBrute = FindObjectOfType<bruteController>();
    //Starts it out so that the player can attack
    playerCanAttack = true;

}

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

    //
    //
    //All needed to flip the player attack when moving left
    //
    //
    //theBruteDeath = FindObjectOfType<bruteDeath>();
    //theBrute = FindObjectOfType<bruteController>();
    //Sets the playerVelocity to the live playerVelocity
    playerVelocity = thePlayer.playerVelocity;
    //Transfers the lastMoveRight variable to this script
    lastMoveRight = thePlayer.lastMoveRight;
    //Converts the position to a double
    playerTransformXDouble = thePlayer.transform.position.x;
    //Converts the double to a float
    playerAttackMovedLeft = (float)(playerTransformXDouble - moveLeftDist);
    //Sets the attack to the left of the player by a certain amount
    playerLocationLeft = new Vector3(playerAttackMovedLeft, thePlayer.transform.position.y, thePlayer.transform.position.z);
}

//
//
//
//THIS CODE HAPPENS WHEN THE PLAYER ATTACKS OR ATTEMPTS TO ATTACK:
//
//
//

//Is able to be called from the playerController when the player attacks
public void playerAttack()
{
    //Will run if the player can attack
    if(playerCanAttack == true)
    {
        //Calls the playerAttackCo() to start
        StartCoroutine("playerAttackCo");
    }
}
//The Co-routine to add the delay into the attack, so you cant spam attack.
public IEnumerator playerAttackCo()
{
    //Makes the player not able to spam the attack button
    playerCanAttack = false;
    //Starts both co-routines below
    StartCoroutine("playerAtAnCo");
    //Will run if the player is moving right
    if(playerVelocity >= 0.1)
    {
        StartCoroutine("playerAcAtCoRight");
    }
    //Will run if the player is still
    if(playerVelocity == 0)
    {
        StartCoroutine("playerAcAtCoStill");
    }
    //Will run if the player is moving left
    if(playerVelocity <= -0.1)
    {
        StartCoroutine("playerAcAtCoLeft");
    }
    //Sets the canMove variable in the playerController to false
    thePlayer.GetComponent<playerController>().canMove = false;
    //Adds the actual delay for the number of seconds that playerAttackDelay is defined to.
    yield return new WaitForSeconds(playerAtAnLength);
    //Sets the canMove variable in the playerController to true
    thePlayer.GetComponent<playerController>().canMove = true;
    //When the delay is over, the player can attack again.
    playerCanAttack = true;
}
//This Co-routine adds enough delay so that the actual animation is played only once
public IEnumerator playerAtAnCo()
{
    //Sets the isAttacking variable in the playerController to true
    thePlayer.GetComponent<playerController>().isAttacking = 1;

    //Adds enough delay so that the animation is displayed
    yield return new WaitForSeconds(playerAtAnDelay);

    //Sets the isAttacking variable in the playerController to false
    thePlayer.GetComponent<playerController>().isAttacking = 0;
}

//This Co-routine adds the actual damage part into the attack
public IEnumerator playerAcAtCoRight()
{
    //Sets the delay for the actual damage to be given
    yield return new WaitForSeconds(playerAcAtDelay);
    //Spawns the attack radius
    Instantiate(playerActualAttackCollider, thePlayer.transform.position, thePlayer.transform.rotation);
}
//Lists all of the brutes?
public List<bruteController> Brute
{
    //Gets a brute
    get;
    //Sets the brute as a current brute.
    set;
}
public IEnumerator playerAcAtCoLeft()
{
    //Sets the delay for the actual damage to be given
    yield return new WaitForSeconds(playerAcAtDelay);

    //Still need to flip instantiate transform position
    Instantiate(playerActualAttackCollider, playerLocationLeft, thePlayer.transform.rotation);
}

public IEnumerator playerAcAtCoStill()
{
    //Sets the delay for the actual damage to be given
    yield return new WaitForSeconds(playerAcAtDelay);
    //Will run if the last move was right
    if(lastMoveRight == true)
    {
        //Will run and place the attack radius on the right if the player is facing right
        Instantiate(playerActualAttackCollider, thePlayer.transform.position, thePlayer.transform.rotation);
    }
    //Will run if the last move is left
    if (lastMoveRight == false)
    {
        //Will run and place the attack radius on the left if is the player is facing left
        Instantiate(playerActualAttackCollider, playerLocationLeft, thePlayer.transform.rotation);
    }
}

}

bruteDeath Script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class bruteDeath : MonoBehaviour
{

private bruteHealth theBrute;

public Sprite deadBrute;

private Animator myAnim;

public float timeToEnd;

public LevelManager theLevelManager;

public Sprite bruteSprite;

public Vector3 brutePosition;

public Vector3 bruteRotation;

public GameObject deadBody;

private Vector3 bruteLastPosition;

//The health of the brute
public float bruteHealthPoints;

//References the playerController script
private playerController thePlayer;

private float playerAt1Dam;

// Use this for initialization
void Start()
{
    theLevelManager = FindObjectOfType<LevelManager>();
    theBrute = FindObjectOfType<bruteHealth>();
    myAnim = GetComponent<Animator>();
    bruteSprite = GetComponent<Sprite>();

    //Actually finds the object with the playerController script
    thePlayer = FindObjectOfType<playerController>();
    //Sets the player Attack 1 Damage in this script to the defined amount in the playerController
    playerAt1Dam = thePlayer.playerAttack1Dam;
}

// Update is called once per frame
void Update() {
    //Checks to see if the brute has run out of health
    if (bruteHealthPoints <= 0)
    {
        //If the brute has no health, then they are removed from the world. Eventually, add an Instantiate with particales
        bruteAnimDeath();
    }
}
public void bruteActualDeath()
{
    bruteLastPosition = new Vector3(theBrute.transform.position.x, theBrute.transform.position.y, theBrute.transform.position.z);
    addDeadBrute();
}
public void bruteAnimDeath()
{
    myAnim.SetBool("bruteIsDead", true);
}
public void bruteDeathAnimDone()
{
    myAnim.SetBool("bruteDeathAnimDone", true);
    bruteActualDeath();
}
public void addDeadBrute()
{
    Destroy(gameObject);
    Instantiate(deadBody, bruteLastPosition, theBrute.transform.rotation);
}
//Kills the brute
public void Kill()
{

}

public void thePlayerAttack1BruteDamage()
{
    //Takes the player attack 1 damage amount away from the brutes health.
    bruteHealthPoints = bruteHealthPoints - playerAt1Dam;
}

}

(I moved the bruteHealth script into the bruteDeath script. Also when I start the game the death animation plays and then another brute spawns right on top… Any idea whats wrong?