Camera facing billboard problem

I am having a hell of a time trying to get a simple plane to face the camera. I have tried everything in all of the following posts:

To try to isolate the problem, I have a scene with nothing but a light, a plane with a JavaScript attached, and a camera.

First I tried this code:

transform.LookAt(Camera.main.transform.position, Vector3.up);

When I put this into the Update function of a JavaScript and slap it on the plane, it rotates! But the edge is always facing the camera rather than the face.

Then I tried several variations of the code described in the CameraFacingBillboard wiki post, including both of the C# scripts.



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

This method seems more accurate, but when I try them, almost nothing at all happens. The plane rotates 90 on the y axis, and then just doesn’t respond to the camera

I’m somewhat new to Unity so it’s probably something simple. Help greatly appreciated.

Easiest solution would be to parent the plane under an empty GameObject, and put your LookAt script in that GameObject. Then if you run the program and the plane’s edge is facing the camera instead of its face, just change its local transform relative to its parent until it’s facing the camera correctly.