Setting angle/rotation of main camera

Hi guys,

Appriciate any help you can provide. I have created a gui button that when pressed makes the firstperson/main camera jump to a certain location in the scene(to a building I want to view). here is my script:
#pragma strict
var btnTexture : Texture;

function Start () {

}

function Update ()
{

}

function OnGUI() {
if (GUI.Button(Rect(10,10,50,50),btnTexture))
{
print(“here”);
transform.position = Vector3(342.023,36.76291,28.57735);

}
}

My question is how do I set the angle of the camera after it transforms to this hard coded position so that the camera is facing the building in question, how do i hard code the angle/rotation of the camera?

Thanks for any help,
James.

If I am not mistaken, you just want the camera to always face the building? You can simply use LookAt ( ) for that (most simple way).

function Update( ){
   transform.LookAt ( BuildingObjectHere.transform ) ;// Param type Transform
}// Will cause Camera to look at building regardless of position.
//Attach to Camera.

Please inform me if I have misread your question, and I will try my best to re-read it, and find another solution, but, I hope this helps you.

you could use

Camera.main.transform.rotation = Quaternion.Euler(25.6,283.2,9.5);