Hi guys, I’m a total newbie to coding and would appreciate some help please. I’ve been following a tutorial for a countdown which will disable car movement until the count finishes.
Here is the full script for the countdown.
var guiCountDown : GUIText;
var countMax : int;
private var countDown : int;
function Start(){
guiCountDown.enabled=true;
GameStart();
}
function GameStart(){
var car = gameObject.Find("PlayerCar 1");
var drivingScript = car.GetComponent("PlayerCar");
drivingScript.enabled=false;
for (countDown = countMax; countDown>-1;countDown--){
if(countDown == 0) {
guiCountDown.text = "GO!";
}
else
guiCountDown.text = countDown.ToString();
yield WaitForSeconds(1);
}
guiCountDown.enabled=false;
drivingScript.enabled=true;
}
I get the error: BCE0019: ‘enabled’ is not a member of ‘UnityEngine.Component’. (14,23)/ (29,23)
Any ideas where I have gone wrong?