> maybe this fixes your problem?
>
yes its a lot simpler, the only problem i see is, when i dont move the enemy shakes, instead of staying still, any advice?
use the platform behaviour and do this
if player.x is greater (>) than enemy.x then -> simmulate control pressing right
if player.x is lesser (<) than enemy.x then -> simmulate control pressing left
to eliminate any kind of odd behaviour like the enemy geting to the same X as player and starting to freak out you should do this
if player.x is greater (>) than enemy.x +20 then -> simmulate control pressing right
if player.x is lesser (<) than enemy.x -20 then -> simmulate control pressing left
im not sure about the +20 and -20 if it looks odd switch them around...