I am creating a 2D rpg game with overhead perspective. For the enemies I have sprites with 4 direction animations. In my algorithm the enemies are created outside the camera and move toward the player but, even if I deselect the “allows diagonals” option in the “TopDownMovement” behavior, they move in diagonal. Is there a way to impose only 4 directions movement to the enemies as they move toward the player (i.e. like zig-zag but 90 degrees for the angles)?
You’re not using events of the TopDown Movement behavior to move your objects. Your using built in forces, which are moving the object in a single direction, regardless of the behavior. See:
Instead, you need to simulate key press on the behavior, or use something more appropriate like Pathfinding, or roll your own logic using events and force that are not going directly to the user.