Hello. I am making a racing game and I need now some help. I want to enable my car if I press a button, and than I should drive. But I dont know why my script isnt working. What is wrong with it? Here is the Script:
var car = GameObject.Find(“Car Audi R8 2006 N250211”);
var came : GameObject;
function Update () {
}
function OnGUI (){
GUI.Box(Rect(100,100,600,400),“”);
if(GUI.Button(Rect(120,450,100,20),"AudiR8")){
car.enabled = true;
came.enabled = false;
}
}
Can anyone help me pls? How can I enable disabled gameobjects?