I am trying to draw a quad and having a problem, which I am sure is me missing something. Hopefully someone can help.
Here is the code:
var mat : Material;
function Awake(){
var goobVec = GameObject.Find("goober").transform.position;
Graphics.DrawQuad(mat, goobVec, 2);
}
I attached this script to a camera and also attached it to an empty gameObject with a renderer.
Thanks in advance for the help!
– Clint
Still no luck with this. 
Not sure what is going on but I just can’t see the quad I am trying to create and actually have no idea even if it is being generated.
Can someone please help shed some light on this for me.
Thanks!
– Clint
The drawquad function is an immediate mode rendering function, so it is meant to be called every frame during rendering with each camera.
What exactly do you want to do? Just put a single quad in the scene?
You could just use GameObject.CreatePrimitive(PrimitiveType.Plane);
You can also build the quad yourself using the mesh interface:
http://unity3d.com/Documentation/ScriptReference/Mesh.html
Hiya Joe!
I am looking to create a speech bubble to pop over a character in a 3rd person view.
Thanks.
– Clint
Create primitive is fine for that purpose:
(I havent tested the code, but it should give you an idea)
function Start ()
{
var go = GameObject.CreatePrimitive(PrimitiveType.Plane);
go.renderer.material = material;
go.transform.position = myPos;
go.transform.localScale = Vector3 (0.2, 0.2, 0.2);
}
function LateUpdate ()
{
// billboard it so it always faces the camera
go.transform.LookAt(Camera.main.transform);
}
Thanks alot for the help!
– Clint
Okay, so I worked with what you have a am getting a primitive but the rotation is all whacked out. I have tried setting it but I get an error about missing variable or some such.
Here is the code and it is attached to a GameObject.
var mat : Material;
var go;
function Start ()
{
go = GameObject.CreatePrimitive(PrimitiveType.Plane);
go.renderer.material = mat;
go.transform.position = gameObject.transform.position;
go.transform.localScale = Vector3(0.2, 0.2, 0.2);
}
function LateUpdate ()
{
// billboard it so it always faces the camera
go.transform.LookAt(Camera.main.transform);
}
Really no different. 
Anyway, any ideas on the rotation and getting it to actually face the camera instead of looking flat.
Thanks,
– Clint
Ah it’s because the plane’s normal is not the z-axis but the y-axis of course.
Just create a plane whose normal faces along the z-axis in some 3d modeller.
Or you use the FromToRotation function:
var mat : Material;
private var go : GameObject;
function Start ()
{
go = GameObject.CreatePrimitive(PrimitiveType.Plane);
go.renderer.material = mat;
go.transform.position = gameObject.transform.position;
go.transform.localScale = Vector3(0.2, 0.2, 0.2);
}
function LateUpdate ()
{
// billboard it so it always faces the camera
go.transform.rotation = Quaternion.FromToRotation(Vector3.up, Camera.main.transform.position - go.transform.position);
}
Also for performance reasons you should statically type the game object by writing:
Thanks! I will work with that and see what I get! 
As far as static typing, thanks for the heads up there. Anywhere I can get more information about those information nuggets. 
Thanks,
– Clint