How to create billboarding planes

Hi, I havent been able to find any tutorials on how to billboard a plane with unity iphone. For example, i want to have a plane with a grass texture on it, and as I move around it, the plane rotates so that it is facing me. I know that this is used in the grass in the Island demo, so I know it is possible. Thank you in advance.

PS: If I applied a "look at" script to each piece of grass, would that be the most efficient way, or is there an easier and faster way built into unity?

For planes, you can just use this to billboard them:

function Update()
{
    transform.rotation = Camera.main.transform.rotation;
}

Which you can optimize a little more if you store a reference to the camera's transform in Start

Unless the camera moves or rotates, the target doesn’t need to rotate. And since you normally know when the camera has moved or rotated (since something in your code made that happen), you can update the billboard’s rotation then. No need to do it every frame!

just add this to the bilboard in a script

function LateUpdate ()
{
myTransform.LookAt(target);
}
function Awake ()
{
var myTransform = transform; //cache the transform
var target = Camera.main.transform; //cace the transform of the camera
}

always use caching in iphone if you are not memory bound.

I tried the lookat(), but that looked really bad, this is what worked for me
(however, best would probably be to make a shader that rotates them)

//use the scripts on quads
//example:
//GameObject go = GameObject.CreatePrimitive(PrimitiveType.Quad);
//go.gameObject.AddComponent(typeof(Billboard3D));

/// <summary>
/// Billboard that only rotates in one angle and looks flat from above
/// </summary>
public class Billboard2D : MonoBehaviour
{
    Camera cam;
    void Start()
    {
        cam = Camera.main;
    }
    void Update()
    {
        //made for a game where Y is up
        Vector3 rot = cam.transform.rotation.eulerAngles;
        rot.x = 0;
        rot.z = 0;
        transform.rotation = Quaternion.Euler(rot);
    }
}

/// <summary>
/// Will make a quad always face the camera
/// </summary>
public class Billboard3D : MonoBehaviour
{
    Camera cam;
    void Start()
    {
        cam = Camera.main;
    }
    void Update()
    {
        transform.rotation = cam.transform.rotation;
    }
}

Make sure Z axys is forward…

If you have a moving camera on a scene, say, on a player, use Tranform.LookAt() instead.
I created Quest markers for my game using this process to mark enemies the player has spotted.

 GameObject target; // the camera or what you want to look at
    
    void Update()
    {
        transform.LookAt(target.transform); // Look at the target's transform
    }

The Hack I used is to create a properly scaled UI element, set to real world coordinates, or use a 2D Sprite, and have it constantly facing the camera.

You also may want to experiment with parenting the object in hierarchy In the event it is not rotating properly, or looking up at the camera. Usually rotating the object by Y:-90 and parented to an object, that has this script attached will work.

Sorry for long post, Have Fun!