How do I instantiate?

My code is

#pragma strict
public var Brick : Rigidbody;
function Update() {
	var brickInstance : Rigidbody;
	brickInstance = Instantiate(Brick);

It should work, but it returns “ArgumentException: The thing you want to instantiate is null.
UnityEngine.Object.CheckNullArgument (System.Object arg, System.String message)”

What’s wrong?

Make type of public variable “Brick” as GameObject. Instantiate takes only GameObject argument type. If you want to access to the components of the object use GetComponent instead.

BTW, setting Instantiate in Update function will drastically slow performance because it will spawn one object per frame (60 objects in second). I do not recommend it.