How to make following enemy for a platformer

Hello. Currently, I am making a pretty simple platformer game where you beat up guys as you defeat a science company or whatev. Just imagine reverse Half-Life without the aliens.

I am currently in the process of making the gameplay so I can prepare for the first level n such. At the moment, I’m stuck with my first (main) enemy. The goal of this enemy is to be exactly like the player but half as speedy (and anything else I add in the future). However, I cannot program the first step: making the enemy follow the player.

I do not want to go down the path of a back-and-forth enemy. It doesn’t fit the style of the platformer. I want an enemy that will possibly use a pathfinding system to go to the player and attack them. As long as the enemy can walk to the player’s location, I can do the rest.

I just can’t find the right things to piece together to create it. How do I make an AI platformer character that’ll attack the player?

Highly depends on your game and enemy behavior in-game.
You could check the distance between player and enemy using “Distance between two objects” and apply movement if under a set distance.
You could check the difference between X positions (for horizontal line of sight) or Y positions (for vertical line of sight) and apply movement if under a set distance.

Or you could use a helper sprite to represent the enemy’s line of sight attached to the enemy and apply movement if the player collides with the line of sight sprite.
Something like this

The video you linked appears to be for ranged enemies. I may use this in the future, but I need an enemy that’ll get right into the player’s face.

I want to try the other method you suggested, but I need a better way of knowing how to do it.