I needed a script to calculate the direction of a sprite based on two vectors for my newest game: https://scratch.mit.edu/projects/944142697/ I decided to share this little test-bed project! How does this work? ⚠️ Nerdy answer warning! ⚠️ This script moves the arrow based on two velocities--xvel, and yvel, but then how do you rotate the sprite to face in the correct direction? Well, it is pretty simple! (kind of...) First you calculate the slope (rise/run or yvel/xvel), then you find the atan (opposite/hypotenuse) of that value to turn it into degrees, but you also have to account for scenarios where you are going left and down, or left and up where you need to add a couple degrees to the answer, or else you will point in the opposite direction. Log: 12/24/23 - Shared! 12/23/23 - Finished Code #velocity #math #direction #trigonometry