I set up a lock-on system that will always look towards the nearest enemy. If you dash without holding a direction while locked on the character will always dash towards the target (since when you're locked on, if you're not holding a direction your rotation is always set towards the target)