Im trying to get 3 cameras automatically change to the next camera after a set period of time on a constant loop so they can pan around an object whilst the game is inactive. A fade on these would also be nice but i have struggled with this too as i seem to only be able to get it to work between two cameras and it seems to fade straight back and forth. I worked on modifying the crossfade script to use time rather than the input.
So to change between cameras i have tried something like this… (where i can assign a different shot duration to each camera. Problem is i have them all under function update and this may be causing an issue. Its frustrating as i can understand why this might not work but i cant seem to get my head around a different way of doing it. Trying hard to learn code!)
var camera1 : GameObject;
var camera2 : GameObject;
var camera3 : GameObject;
var shotDuration1=25;
var shotDuration2=25;
var shotDuration3=25;
function Update () {
if (Time.time > shotDuration1){
camera1.camera.enabled = true;
camera2.camera.enabled = false;
camera3.camera.enabled = false;
}
if (Time.time > shotDuration2){
camera1.camera.enabled = false;
camera2.camera.enabled = true;
camera3.camera.enabled = false;
}
if (Time.time > shotDuration3){
camera1.camera.enabled = false;
camera2.camera.enabled = false;
camera3.camera.enabled = true;
}
}
I just need to get it to order correctly as i have had this working between to cameras but it has stopped working lol
Any direction would be much appreciated!