I have the following code to move an "enemy" to my "players" position.
let follow = SKAction.moveTo(player.position, duration: 2)
enemy.runAction(SKAction.repeatActionForever(action), withKey: "moving")
This code works fine. However, when I move the player, I would like the SKAction to "run again" so that the enemy is always moving towards the last location that the player was at. Therefore, if the player does not keep moving, they will eventually get caught.
How come the "repeatActionForever" is not working? The enemy moves to the initial location of the player, but when you move the player to a new location, the enemy does not move to that new location.
Thanks :D