1

So technically, it already follows the player to the right, and you want it to move to the right and left side, while it stops if it gets too close? In the given context, I think this is all you need: if (obj_testPlayer.x > x + 34) { // want it to stop 34 pixels away from the players left xspd += 3 } else if (obj_testPlayer.x < x - 34) { xspd -=...


Only top voted, non community-wiki answers of a minimum length are eligible