I’m trying to disable components in the same gameobject, but end up getting this error:
"The type or namespace name `Script’ could not be found. Are you missing a using directive or an
assembly reference?
"
Here is my code:
using UnityEngine;
using System.Collections;
public class CarOnlyDriveIfInside : MonoBehaviour {
private Script CarC;
private Script CarUC;
void Start ()
{
CarC = GameObject.Find("Car").GetComponent<CarController>();
CarUC = GameObject.Find("Car").GetComponent<CarUserControl>();
}
void Update () {
if (GlobalVariables.driving == 1 && GlobalVariables.hover == 0)
CarC.enabled = true;
CarUC.enabled = true;
}
}