Hi all,
I use the function Quaternion.FromToRotation to resolve collisions between spheres converting the position error of my objects in rotations of the parent, centered in the origin (the object move on a sphere).
The problem is that is the from and to Vector3 have the z component for instance that differs by 0.005, the rotation returned by the function is 0. If I use Vector3.Angle instead, I get a non zero angle.
Any ideas?
Could you post the code you are using.
From the sound of it you would need to use the angle, however, you could also just as easily use (angle < 0.05) instead of (angle == 0);
Are you using Debug.Log or print to see if its 0? these functions will round the string to so many decimal places unless you do a ToString manually. Also the Vector3 ToString operator does this as well. Its misleading.