This was my solution for keeping the dead enemies from interfering with raycasts that seems to be working fine, can someone let me know if this will cause any problems in future lessons?
I just disabled the capsule collider, which means that we can’t hit it with our raycast, and then disabled the NavMeshAgent so that the player could run through the dead bodies. Disabling the NavMeshAgent isn’t necessary if you don’t mind kicking the dead bodies around as you run into them. Here is the actual code:
private void Die()
{
isDead = true;
GetComponent<Animator>().SetTrigger("dead");
GetComponent<CapsuleCollider>().enabled = false;
GetComponent<NavMeshAgent>().enabled = false;
}