- Home /
 
               Question by 
               FH_88 · Feb 22, 2014 at 04:52 PM · 
                camerajavascripttimerswitch  
              
 
              Camera switch after specific time
I have tryed making a code, that makes the scene start at one camera(third person) and then after a specific time it switches to another camera(first person). The only problem is, that it doesn't show any errors but the code won't work, it doesn't switch camera.
Can anyone tell me what is wrong?
Here is the code
 var camera1:Camera;
 var MainCamera:Camera;
 
 function Start () {
 
 camera1.enabled = true;
 MainCamera.enabled = false;
 
 }
 
 function Switch(){
 
 if (camera1.enabled == true) {
     
     yield WaitForSeconds(1.0);
     camera1.enabled = false;
     MainCamera.enabled = true;
     }
     
 }
               Comment
              
 
               
               
               Best Answer 
              
 
              Answer by robertbu · Feb 22, 2014 at 04:53 PM
No where in this code are you calling Switch(). Insert at line 8:
 Switch();
Your answer
 
 
             Follow this Question
Related Questions
Camera switching : C# onTriggerEnter not working 1 Answer
How to change overlay with timer? 0 Answers
Play anim, javascript 1 Answer
Switching Cameras - Confusion with Two Code Samples 2 Answers
Switching cameras (JavaScript) 0 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                