using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BasicAI : MonoBehaviour {
public Transform target;
public Transform target2;
public Transform myTransform;
void Update () {
transform.LookAt(target);
transform.LookAt(target2);
transform.Translate(Vector3.forward*5*Time.deltaTime);
}
}
This is the code I am using to make an enemy follow the player around, it works well but the enemy goes through walls despite them having collisions.
Does anyone know how to stop this from happening?