Waypoint System in C#

Good morning everyone
I want to create a waypoint system with this properties

  1. Chase On and Chase Off
    If the Chase is On then the enemy will chase the player moving between waypoints,
    else the enemy will simply move between waypoints.
  2. The enemy will animate will moving
  3. If the player is in the range, then start attacking
    Anyone has any idea for this? Thanks in advance
    have a nice day!

create a script that stores the way points in an array or list and that animates the enemy when it is moving. The attacking can also go into the Enemy AI script. I know their aren’t many Waypoint tutorials out there but check this out it may help.

if you need to do it from scratch check this out to get a better idea

Also if you have some cash to spend check out these videos Digital Tutors

Oh right, I already have bought Digital Tutors, I has forgotten, now i’ll go, thanks, have a nice day!

but it is in js
i need in c#
can you please help me in chasing player with waypoints?
The best way is to use A Pathfinder, but is too long!
So I decided to make by my self.
My idea is this:
The chase range is really small.
So the enemy only check if the player is in front of it or not, othervise check only if is near to next waypoint, or to previous!
i am able to check which is near waypoint, but not to check if is in front of or not, can you please help me?

you can use raycasting and or colliders to see if the player is in front, now sometimes depending on the setup of your game it’s more easy if you just get the player position and if he’s close then the enemy starts to turn and react, then if the enemy sees the player attack and so on.