Hello Im working on a simple cinematic script but the player and camera1 wont go back active can someone help me please.
Camera1 is in Player GameObject.
Camera2 is not
#pragma strict
var Camera1 : GameObject;
var Camera2 : GameObject;
function OnTriggerEnter (theCollider : Collider)
{
if (theCollider.tag == "Player")
{
GameObject.Find("Player").SetActive(false);
Camera1.SetActive(false);
Camera2.SetActive(true);
//camera2.GetComponent.<Animation>().Play();
yield WaitForSeconds (10);
}
}
function maincameraswitch ()
{
GameObject.Find("Player").SetActive(true);
Camera1.SetActive(true);
Camera2.SetActive(false);
}
//function OnTriggerExit ()
{
}
#pragma strict
var Camera1 : GameObject;
var Camera2 : GameObject;
var player : GameObject;
function OnTriggerEnter ()
{
player.SetActive(false);
Camera1.SetActive(false);
Camera2.SetActive(true);
//camera2.GetComponent.().Play();
}
function maincameraswitch ()
{
player.SetActive(true);
Camera1.SetActive(true);
Camera2.SetActive(false);
}
function OnTriggerExit ()
{
Maincameraswitch();
}
#pragma strict
var Camera1 : GameObject;
var Camera2 : GameObject;
var player : GameObject;
function OnTriggerEnter ()
{
player.SetActive(false);
Camera1.SetActive(false);
Camera2.SetActive(true);
//camera2.GetComponent.<Animation>().Play();
}
function maincameraswitch ()
{
player.SetActive(true);
Camera1.SetActive(true);
Camera2.SetActive(false);
}
function OnTriggerExit ()
{
maincameraswitch();
}
#pragma strict
function OnTriggerEnter (player : Collider) {
if(player.tag=="Player")
GameObject.Find("Sphere").GetComponent.<Animation>().Play("SphereTrigger");
}