My Enemies walk through objects and my FPS character model

My Enemy character models are walking through any objects and my FPS character model?
I am very new to Unity developing and I am completely lost as to why this is happening?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class ChaseScript : MonoBehaviour {

    public Transform player;
    static Animator anim;
    public NavMeshAgent agent;

    void Awake()
    {
        player = GameObject.FindGameObjectWithTag("Player").transform;
    }

    // Use this for initialization
    void Start () {

        anim = GetComponent<Animator>();

    }

    /*void OnTriggerEnter(Collider col)
    {
        Debug.Log(col.tag);

        if(col.tag == "Player")
        {
            SceneManager.LoadScene(2);
        }
    }*/

    // Update is called once per frame
	void Update ()
    {
        agent.SetDestination(player.position);

        Vector3 direction = player.position - this.transform.position;
        if (Vector3.Distance(player.position, this.transform.position) < 10)
        {
            
            direction.y = 0;

            this.transform.rotation = Quaternion.Slerp(this.transform.rotation,
                                        Quaternion.LookRotation(direction), 0.1f);

            anim.SetBool("isIdle", false);
            if(direction.magnitude > 5)
            {
                this.transform.Translate(0, 0, 0.075f);
                anim.SetBool("isWalking", true);
                anim.SetBool("isAttacking", false);
            }
            else
            {
                anim.SetBool("isAttacking", true);
                anim.SetBool("isWalking", false);
            }

        }
		else
        {
            anim.SetBool("isIdle", true);
            anim.SetBool("isWalking", false);
            anim.SetBool("isAttacking", false);
        }
	}

}

Any help would be greatly appreciated.

The issue is that you are moving objects with transform.Translate(). The translate function doesn’t take physics into account, as it just teleports the object to the desired position, and ignores all collisions.

The best way to fix it would probably be to attach a rigidbody to the object, and move it using the rigidbody’s addForce method. Another alternative would be to use Unity’s CharacterController object, and call Move() on it. Either way, you’re probably going to have to make a few changes to how your movement is being done. Here’s some references to get started:

Remember what you have done here with the Translate movement method. It will come in handy later if you want to move specific objects around your game without collisions being fully detected.

I’m going to second @Jawchewa on this one, because he’s correct.

Another thing you could do, is also ensure that you have proper colliders setup on each object (incase) the problem still persists once you have modified your code.

Also, if in the future you want to remove certain collisions from colliding with specific objects, you can add something similar to the following.

//The following would go into your Collision Detection function.

if (col.transform.tag == "secret_passageway") {
	Physics.IgnoreCollision (col.collider, GetComponent<Collider> ());
}

Add Capsule Collider or Box collider to your enemy. Your enemy will solid.