Enemies trying to get through obstacle layer


I recently downloaded the free version of this plug in to try and implement a simple AI that will follow the player along a set path and then stop and shoot when in a certain radius. The only thing on the enemy is a seeker script. I currently have a problem where the enemy will get stuck trying to pass through the obstacle layer (which are walls) instead of trying creating a path that ignores the walls. Is there a way of solving this issue?

For reference I will show my script for the enemy:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Pathfinding;
public class AlienBehaviour : MonoBehaviour
public Transform target;
public Transform alien;
public float speed = 200f;
public float nextWaypointDistance = 3f;
public Transform fire;
public GameObject bullet;
Path currentPath;
int currentWaypoint = 0;
bool end = false;
//private float timer = 0.5f;
Seeker seeker;
Rigidbody2D rb;
// Start is called before the first frame update
void Start()
seeker = GetComponent();
rb = GetComponent();
InvokeRepeating(“UpdatePath”, 0f, .5f);
void UpdatePath()
float stoppingDistance = Vector3.Distance(rb.position, target.position); //range where the enemy will stop and shoot
if (stoppingDistance <= 3.0f)
return; //UpdatePath will not be initiated if it’s in stopping distance
if (seeker.IsDone()) seeker.StartPath(rb.position, target.position, PathCompleted); //otherwise a path is created for the alien to follow
void PathCompleted(Path p)
currentPath = p;
currentWaypoint = 0;
// Update is called once per frame
void FixedUpdate()
if (currentPath == null) return;
if (currentWaypoint >= currentPath.vectorPath.Count)
end = true;
else end = false;
Vector2 direction = ((Vector2)currentPath.vectorPath[currentWaypoint] - rb.position).normalized;
Vector2 force = direction * speed * Time.deltaTime;
float distance = Vector2.Distance(rb.position, currentPath.vectorPath[currentWaypoint]);
if (distance < nextWaypointDistance) currentWaypoint++;
if (rb.velocity.x >= 0.01f) alien.localScale = new Vector3(1f, 1f, 1f);
else if (rb.velocity.x <= 0.01f) alien.localScale = new Vector3(-1f, 1f, 1f); //how the enemy follows the player
void Shoot()
Instantiate(bullet, fire.position, fire.rotation);