var kamera1 : Camera;
var kamera2 : Camera;
function Start () {
kamera1.enabled = true;
kamera2.enabled = false;
}
function Update () {
if (Input.GetKeyDown ("e")){
if ( kamera1.enabled == true){
kamera2.enabled = true;
kamera1.enabled = false;
}
else if (kamera2.enabled == true){
kamera1.enabled = true;
kamera2.enabled = false;
camera 1 and camera 2 in same position
it work for switching camera,
but i have trouble in object that put it on one kamera
i assign weapon in kamera2
when i press "e" key for switch kamera, my weapon in kamera2 was still on when i have able kamera 1.
what should i do to get a weapon off when i able kamera2?
(im sorry if i got mistake with my english)
ty so much
If I understand correctly you mean that when you change your camera, camera2 is able to see a weapon in the position where camera1 was. You should place a parent GameObject that contains the camera and the weapon, when you switch camera, instead of enabling/disabling the cameras, you should do it with the parent object.