Cannot Convert string to bool error

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CamSwitcher : MonoBehaviour

{
    public GameObject cam1;
    public GameObject cam2;
   
     // Start is called before the first frame update
    void Start()
    {
       
    }

    // Update is called once per frame
    void Update()
    {
       if (Input.GetButtonDown("v"))
       {
          //setting cam1 active
          cam1.SetActive("True");
          cam2.SetActive("False");
       }
       if (Input.GetButtonDown("c"))
       {
        //setting cam2 active
        cam1.SetActive("False");
        cam2.SetActive("True");
       }


    }
}

It says cannot convert string to bool… what am i doing wrong here?

cam1.SetActive(true);
no “”

2 Likes

Thanks so much!

Just want to call out that I see you playing with camera stuff… Unity offers a Cinemachine package which is pretty awesome in all that it does… might be worth your time to investigate.

Cinemachine can be installed from the Unity Package Manager.

There’s even a dedicated forum: https://forum.unity.com/forums/cinemachine.136/