#pragma strict
var cam01 : GameObject; // first person camera
var cam02 : GameObject; // third person camera
var player01 : GameObject; //first person controller
var player02 : GameObject; //third person controller
var check; // New check-variable
//start with first person active
function Start() {
cam01.gameObject.active = true;
cam02.gameObject.active = false;
player02.active = false;
check = true;
}
function Update() {
//player01.transform.position = player02.transform.position;
if (Input.GetButtonDown ("CharSwitch")) {
if(check) {
cam01.gameObject.active = false;
cam02.gameObject.active = true;
player01.active = false;
player02.active = true;
}
else {
cam01.gameObject.active = true;
cam02.gameObject.active = false;
player01.active = true;
player02.active = false;
}
check = !check;
player02.transform.position = player01.transform.position;
}
}