How do i implement 8 direction swipe function

ok so i tried the acos approach and it didnt seem to be working out so i done some research and tried the atan2 function instead with the broken up X & Y values and now works perfectly. thank you so much for your help :slight_smile: