How do I make a dashing NPC?

How would I create a dashing NPC that attacks you, so if you’re in its line of sight, it dashes towards you and attacks you if close enough?

raycasts + pathfinding

just like loop through each player and make a raycast from the head to the pos of the humanoid root part
if successful use create docs to make a pathfind to the player
attacking just check distance and if close enough run function

3 Likes