Answers for "How to make a 2D sprite rotate towards a specific point while facing perpendicular to the camera ?"
http://answers.unity.com/questions/1487017/how-to-make-a-2d-sprite-rotate-towards-a-specific-1.html
The latest answers for the question "How to make a 2D sprite rotate towards a specific point while facing perpendicular to the camera ?"Answer by Scribe
http://answers.unity.com/answers/1487421/view.html
This is a definitely a good time to use Quaternion.LookRotation, unfortunately the way you want to specify the directions is a bit convoluted because of the orientation that you want.
The inmortant bit to notice is that you want the forward direction (the worms blue axis) to oint at the camera, which I have assumed is in the direction `-Vector3.forward` (on the penultimate line), and the up direction is not straight up, we have to calculate oour up direction by knowing it is perpendicular (at right angles to) the `relativePos` vector that you calculated. The following is untested but it should give you something to go on, [this might help understanding][1]
Vector3 relativePos = target.transform.position - worm.transform.position;
// get the desired up vector by finding the vector perpendicular to relativePos
// and make sure we have a positive y value
// the following works because if y is going to be negative then Mathf.Sign is -1 and so inverts the vector
// otherwise it does nothing
Vector3 desiredUp = new Vector3(relativePos.y, -relativePos.x, 0) * Mathf.Sign(-relativePos.x);
Quaternion rotation = Quaternion.LookRotation (-Vector3.forward, desiredUp);
worm.transform.rotation = rotation;
Hope that helps!
[1]: https://gamedev.stackexchange.com/questions/70075/how-can-i-find-the-perpendicular-to-a-2d-vectorFri, 30 Mar 2018 19:09:23 GMTScribe