Best way to make an AI enemy charge towards a players position every few seconds

Hello. I’m having a hard time coming up with a way to have an enemy charge at a players position every few seconds when the player gets too close.

any info would help greatly. I’m just lost on starting this.

Well if you use the Pythagorean theorem to figure out the distance between the player and enemy and you can check if that number is smaller or equal to however close you need to be for the enemy to charge but I’m not sure about the actual charging part well maybe if you had a vector to that stored the distance between the player and the enemy on the Y axis and the distance between the player in the enemy on the X axis then you could divide both of those numbers by 10 and add the results to the transform position of the enemy and then loop adding the results to the transform position of the enemy 10 times in theory