Billboarding Sprite issue.

Here’s my generic code:

using UnityEngine; 
public class Billboard : MonoBehaviour {
     void Update() { 
        transform.LookAt(Camera.main.transform.position, -Vector3.up); 
     } 
}

But there’s a problem with it. I created a small plane, and added just a leaf texture to it for testing, like this: Pic1

But when i run it, it faces incorrectly? Like this:
Pic2

Notice the camera and the plane are like this?
Camera is looking at it instead of | vertical, its – Horizontal to it.

How do i fix this? I tried making the vector3.up positive, and setting it to down… no change.

It’s because LookAt points the blue axis at the target (unfortunately the plane is horizontal when that happens). Try this:

 	transform.LookAt(transform.position + Camera.main.transform.rotation * Vector3.up,Camera.main.transform.rotation * Vector3.back);