assign a camera to a variable

I need the script to assign its camera automatically to the var. here is the part of the script.

var Cam : Camera;  

function Start()
{	
	Cam = GameObject.Find("Camera").camera;
	
}

thanks in advance :slight_smile:

If it’s the main camera…

var Cam : Camera;  
 
function Start()
{   
    Cam = Camera.main;
 
}

Or to find any camera…

var Cam : Camera;
var GOCam : GameObject;

function Start()
{   
    GOCam = GameObject.Find("Name of the camera");
    Cam = GOCam.camera;

}