Answers for "Finding the angle between 2 clicked points"
http://answers.unity.com/questions/223560/finding-the-angle-between-2-clicked-points.html
The latest answers for the question "Finding the angle between 2 clicked points"Answer by fafase
http://answers.unity.com/answers/223845/view.html
Well,
you have your x and y coordinates from your mouse clicks you said.
Store the coordinates of your clicks and calculates the distance between them , you have found the hypotenuse (hyp) of your triangle. With
hyp = Vector2.Distance(click1,click2);
Now with
xtot =click.x - click1.x;
you get the adjacent side.
Now with
angle = Mathf.Acos(xtot/hyp);
you have your angle.
Is that what you need?Mon, 05 Mar 2012 14:11:04 GMTfafaseAnswer by jakovd
http://answers.unity.com/answers/223813/view.html
Are you sure you need that expressed as an angle? I would use vectors to fire a projectile. You get direction vector simply by subtracting first positions from the second position vector.
If you go with vectors, you can still get an angle from it, but as Jean Fabre mentioned, you need a reference vector (the one that you consider to be at 0 degrees).Mon, 05 Mar 2012 12:24:45 GMTjakovd