Answers for "Get rotation from a vector direction."
http://answers.unity.com/questions/1382256/get-rotation-from-a-vector-direction.html
The latest answers for the question "Get rotation from a vector direction."Answer by Bunny83
http://answers.unity.com/answers/1382287/view.html
The success of this line:
Vector3 turn = Vector3.Cross(Vector3.up, A - B);
highly depends on which plane you use for your RTS game. This assumes that A and B are both inside the X - Z - plane. If you use the X - Y - plane (the usual 2d GUI plane) the cross product will result either in "Vector3.forward" or "-Vector3.forward"
In addition you should make sure that "AB" is actually a non zero vector. Or in other words: make sure your two hit points are not the same.Fri, 21 Jul 2017 11:23:19 GMTBunny83