1. If your player starts attaking, you have to set the perfect position for the attack by code (or just attack if he is in the right position range).
2. You have to change the moving direction related to the direction you want to move (e.g. not mirrored ->, mirrored <-) by code.