//this is my ChangeCameraMoreSimple.cs script
// CharacterController.js is another script, I tried adding the script, CharacterController, but got this problem
using UnityEngine;
using System.Collections;
public class ChangeCameraMoreSimple : MonoBehaviour
public class CharacterController : MonoBehaviour
{
public GameObject carCamera;
public GameObject playerCamera;
public GameObject Car;
public GameObject Player;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetKey(KeyCode.E))
{
carCamera.active = true;
playerCamera.active = false;
Player.active = false;
Car.active = true;
}
if (Input.GetKey(KeyCode.R))
{
playerCamera.active = true;
carCamera.active = false;
Player.active = true;
Car.active = true;
GetComponent(CharacterController).enabled = true;
}
}
}