Noob Question: Get rotation between 2 world vectors?

Hey everyone,

I have a touch game where I am registering a swipe. I grab the world location vector when you press, and grab the world location vector where you release. I am able to calculate the distance, and if it is over a set length, it will register as a swipe.

Now, I am not a programmer, so I am not sure how to get the angle of the two vectors, as it will rotate the character in the direction of the swipe. I found a few different solutions online, but none of them have worked. I’m sure there is some programming 101 thing you need to do before hand.

This is most likely a stupid, easy solution, can anyone help me out?

Well, it is hard to explain without seeing exactly what it is you are trying to do. If I am correct, you have a joystick thing on the screen, and if you press forward on it, it should rotate the character forward, if left, rotate left, etc… Is this correct?

Try the Get Direction Vector node and see if that helps c:

You can take the X and Y components of the difference between the two locations and plug that into atan for an angle…

Wow, that easy, huh? And here I was subtracting vectors and normalizing them before putting it through a dot product -.-

Thanks for the help!