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;
}