Auto-translated
There are some nuances regarding movement. The thing is that a monster with such an animation won't walk back and forth, but rather run forward, teleport backward, and run forward again. So, it needs to be somehow turned around after each cycle.
Perhaps there's a more elegant solution (without turning around) – this can be done with the help of 2 peasants running towards each other (but with a time delay) – then the player will have the illusion that it's the same character running back and forth (although in reality, they are two identical twins).