I can think of two potential solutions to this problem on the top of my head. Either you make your unit instantly face the direction of the cast. Or, you make a dummy spell that when triggered, checks that your units facing angle is the same as the relation between the casting point and the casting unit before actually firing the spell.