A* Pathfinding Project

AI not updating path to target's new location


#1

So I am new to unity and A*, so forgive my misunderstanding.

I have implemented an enemy wave spawner for my top down shooter. The enemy ships spawn randomly at 3 locations then seek the player object, or that is how it is supposed to work. They enemies spawn but only seek one location then stop at that location, they never update as the player is moving around the scene.

I have my player object in the destination setter for the enemy prefab along with the AIPath plus the seeker component. I have no error codes or debug logs.

any help welcome and thanks for your patience in advance.


#2

Hi

How do you set the target?
Are you sure the target is set to the player object and not the player prefab?
The player prefab will never move around. You need to set it to the player instance in the scene when you spawn the agents.


#3

Thank you! Yup that was my issue, Now I have the enemy ship prefab in the hierarchy as an object it solves my issue with spawning and seeking.