If you need the enemy to track the player and being very distant, at the moment it is not possible, because if you use the previous example, the enemy when tracking the player could get stuck. here practically you need artificial intelligence, I am currently developing one but I have not finished it yet, which the enemy could track or search for the player without getting stuck with any obstacle
You can be aware of this forum,
www.gamemaker3d.com/forum/general-discussion/587-a-i as soon as I launch this function, I will not delay in sharing the code