Answers for "Quick Angles Question"
http://answers.unity.com/questions/287789/quick-angles-question.html
The latest answers for the question "Quick Angles Question"Answer by Seth-Bergman
http://answers.unity.com/answers/287795/view.html
see the script reference here:
[http://docs.unity3d.com/Documentation/ScriptReference/Vector3.Angle.html][1]
they use two directions, not two points.. if you think about it, the angle based on two points in space would be relative to the point of origin..
[1]: http://docs.unity3d.com/Documentation/ScriptReference/Vector3.Angle.htmlSat, 21 Jul 2012 00:17:10 GMTSeth-BergmanAnswer by aldonaletto
http://answers.unity.com/answers/287794/view.html
Vector3 is a structure used to store many 3 float values, like points, vectors, angles etc. Transform.position and desiredPosition are points, not vectors, and Vector3.Angle is intended to be used with vectors. In this particular case, you're getting the angle between the vectors (0,0,0)->transform.position and (0,0,0)->desiredPosition, which normally makes no sense. If you want to measure the angle between the transform forward direction and the direction from the transform to the desiredPosition, you should use this:
generalDirection = Vector3.Angle(transform.forward, desiredPosition-transform.position);
A point is a position in the 3D world, while a vector is a direction - you can think of a vector as an "arrow" based on 0,0,0 and pointing to the desired direction. In order to calculate the vector that points the direction from position A to position B, subtract A from B:
directionAtoB = pointB-pointA;
The resulting vector shows the direction A to B, and its length (directionAtoB.magnitude) is the distance between A and B.Sat, 21 Jul 2012 00:15:36 GMTaldonaletto