- Home /
Having issues switching between cameras,Flickering while trying to switch cameras
Hallo, so I've been trying to switch between cameras using this script:
public class CamSwitcher : MonoBehaviour {
//cameras
public Camera cameradronefeed;
public Camera camerabase;
//input bools
private bool changeCam;
// Update is called once per frame
void Update()
{
//if statements for swapping cameras
changeCam = Input.GetKey(KeyCode.C);
if(changeCam == true);
{
camerabase.enabled = !camerabase.enabled;
cameradronefeed.enabled = !cameradronefeed.enabled;
}
}
}
the Issue that I've been having is that in play mode it is constantly flickering between the cameras completely ignoring user input. does anybody know what the issue could be?,Hello, so I've been trying to switch cameras with this script:
public class CamSwitcher : MonoBehaviour {
//cameras
public Camera cameradronefeed;
public Camera camerabase;
//input bools
private bool changeCam;
// Update is called once per frame
void Update()
{
//if statements for swapping cameras
changeCam = Input.GetKey("ChangeCamera");
if(changeCam == true);
{
camerabase.enabled = !camerabase.enabled;
cameradronefeed.enabled = !cameradronefeed.enabled;
}
}
}
when I click play in the editor, it rapidly flickers between the two cameras. completely ignoring any input of mine. can somebody help?
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Overriding Camera.main.ScreenToWorldPoint's z value? 1 Answer
Why are my player controls wierd. 1 Answer
Why is my camera script inverted 1 Answer