I made this script for a game, is can be pretty useful so here ya go
this here also helped me. https://stackoverflow.com/questions/7242546/move-from-angle-a-to-b-find-shortest-direction