GUI camera help needed with script

Hello,

I have a hopefully simple question. I created a simple GUI that I want to use to control specific cameras around the playing field. Each button is assigned to a different camera. What am I doing wrong? When user clicks the Mercury button I want the main view to go to that camera, when they click the Venus button, it switches to that view. Whats the best approach?

/* Planet Menu */

function OnGUI () {
//background box
GUI.Box (Rect (Screen.width - 150,0,150,250), “PLANET SELECTION”);

// If it is pressed, mercury camera will become main camera
if (GUI.Button (Rect (Screen.width - 140,25,130,20), “Mercury”))
{
var newTarget = GameObject.FindWithTag(“mercury”).transform;
GetComponent(Follow).target = newTarget;

}

// Make the second button.
if (GUI.Button (Rect (Screen.width - 140,50,130,20), “Venus”))
{
var newTarget = GameObject.FindWithTag(“venus”).transform;
GetComponent(Follow).target = newTarget;
}

We might need some more details. What does the Follow component do? What does the ‘target’ field do? Also, what sort of problems are you having? Compiler error? Run-time error? Is it just not working as expected?

I don’t see anything there that looks like it would switch the view from one camera to another, but again, without knowing what Follow and Follow.target are, it’s hard to say what the problem might be.