Hello I need help.
Because I have this BrakeLights script I’m working on and I’m stumped on trying to get the script working because it says gameObject not a memeber of GameObject so can I have some help with this please?
Thank You!
#pragma strict
public var brakeLights : Material;
public var BrakeLight : GameObject[];
private var brakes : float;
var minimum : float = 0.0;
var maximum : float = 1.0;
private var LightsTime : float;
function Update () {
if (Input.GetKey("space")== true || Input.GetKey("down")== true){
LightsTime += Time.deltaTime;
brakes = Mathf.Lerp(minimum, maximum,LightsTime*7);
}
else{
LightsTime = Time.deltaTime;
brakes = 0;
}
if(brakes > 0.0){
brakeLights.SetFloat("_Intensity", Mathf.Abs(brakes));
BrakeLight.gameObject.GetComponent(Light).intensity = brakes;
}
else{
brakeLights.SetFloat("_Intensity", 0.0);
BrakeLight.gameObject.GetComponent(Light).intensity = 0;
}
}