Comments and answers for "How to calculate direction between 2 objects"
http://answers.unity.com/questions/697830/how-to-calculate-direction-between-2-objects.html
The latest comments and answers for the question "How to calculate direction between 2 objects"Comment by ChrisJoosten on ChrisJoosten's answer
http://answers.unity.com/comments/697837/view.html
Thank you, this was exactly what I needed :)Wed, 30 Apr 2014 12:22:55 GMTChrisJoostenAnswer by Berenger
http://answers.unity.com/answers/697834/view.html
Let's say camera is your point A, and this is your point B.
Vector3 AB = B - A. Destination - Origin.
This is a direction and a distance. To have only the direction (and a distance of 1), you have to normalize it.
AB = AB.normalized OR AB.Normalize()
In your case :
Vector3 pos = camera.transform.position
Vector3 dir = (this.transform.position - camera.transform.position).normalized
Debug.DrawLine (pos, pos + dir * 10, Color.red, Mathf.Infinity);Wed, 30 Apr 2014 12:14:11 GMTBerengerComment by Nerevar
http://answers.unity.com/comments/697832/view.html
Hi,
You need 3 points/objects to calculate an angle or 2 vectors.
With this code you don't have enough information to get an angle, you need a referential item...
I hope it is clear :p
regardsWed, 30 Apr 2014 12:11:54 GMTNerevarAnswer by HarshadK
http://answers.unity.com/answers/697831/view.html
Check this out: <a href="http://docs.unity3d.com/Documentation/Manual/DirectionDistanceFromOneObjectToAnother.html">Direction and Distance from One Object to Another</a>Wed, 30 Apr 2014 12:11:22 GMTHarshadK