First and foremost, I have an enemy. I want this enemy to possess the following characteristics:
-The enemy follows a predefined path that loops.
-The enemy is subject to gravity, thus it stays grounded.
-The enemy faces in the direction it's moving.
-When the Player comes into the enemy's line of sight, the enemy stops following its path and begins chasing the Player.
-While the enemy is chasing the player, upon getting close to the player, the enemy attempts to attack the player.
I-f the player remains out of the enemy's line of sight for a few seconds, the enemy stops chasing and reverts back to its path.
Up to this point, I've tried a waypoint system, which might have some issues. I also tried a raycasting approach, using multiple rays at the same time, but it didn't work. I attempted to use a sphere collider, but it threw numerous errors. I then tried a cone-shaped mesh collider, but to no avail.