Comments and answers for "Trouble with working out angle between 2 points"
http://answers.unity.com/questions/706368/trouble-with-working-out-angle-between-2-points.html
The latest comments and answers for the question "Trouble with working out angle between 2 points"Comment by robertbu
http://answers.unity.com/comments/706399/view.html
Your code and your words don't match to me, so I'm unsure of what you want. I can suggest a couple things to explore. If this is 2D (just X and Y), you can get an angle of a vector relative to Vector3.right using $$anonymous$$athf.Atan2(). Note that the parameters go into the function y,x. But given your drawing, reversing them might give you what you are looking for.
Second, Vector3.Angle is unsigned. If that works for you fine. If you are looking for a signed angle:
function SignedAngle(v1 : Vector3,v2 : Vector3, normal : Vector3) : float {
var perp = Vector3.Cross(normal, v1);
var angle = Vector3.Angle(v1, v2);
angle *= $$anonymous$$athf.Sign(Vector3.Dot(perp, v2));
return angle;
}Mon, 12 May 2014 15:47:51 GMTrobertbu