Me and my partner are constructing a very basic game. In it, we have a boss that follows a set of waypoints. It follows these waypoints continuously and loops back to the first one once it reaches the last waypoint in the order. After the enemy has a certain amount of health remaining I'm trying to arrange it so that he switches from waypoint list 1, which contains the trail, to waypoint list 2, which only has the waypoint that is attached to the player.
However my attempts at splicing code together fails. At first I tried linking the Movement script to the Health Manager (which records the enemy's current health) so that when the health reached a certain point or lower it would begin to follow the second waypoint array, making it go after the player. However this caused numerous errors when applying the numerous variables involved.
If someone could give me an idea or some theory on how I can switch the enemy from following one set of waypoints to another it would be very much appreciated.