hello everyone i have a problem that i don’t know how to fix as i’m new to coding. the script is a enter car script that i’v tried to convert to an enter a boat script and i almost have it besides this error
Assets/EnterBoat.js(21,53): BCE0044: expecting ), found ‘=’.
this is the script i’m using
#pragma strict
var playerInVehicle = false;
var playerInRange = false;
var test : boolean = false;
var Char : GameObject;
var Car : GameObject;
var Cam : Camera;
var CamTarget1 : Transform;
var CamTarget2 : Transform;
function Awake(){
Car.GetComponent(DW_BoatController).enabled = false;
}
function Start (){
if (Car.GetComponent(DW_BoatController).enabled = false;
}
function Update (){
if (playerInVehicle == true){
}
else if (playerInVehicle == false){
}
Controls();
}
function OnTriggerStay(other : Collider){
if (other.tag == "Player"){
playerInRange = true;
}
}
function OnTriggerExit(other : Collider){
if (other.tag == "Player"){
playerInRange = false;
}
}
function Controls(){
if (playerInRange == true){
if (Input.GetKeyDown("f")){
if (playerInVehicle == false){
playerInVehicle = true;
Char.active = false;
Char.transform.parent = gameObject.transform;
Car.GetComponent(DW_BoatController).enabled = true;
}
else if (playerInVehicle == true && Car.GetComponent(DW_BoatController).currentSpeed <= 0.5 && Car.GetComponent(DW_BoatController).currentSpeed >= -0.5){
playerInVehicle = false;
Car.GetComponent(DW_BoatController).enabled = false;
Char.active = true;
Char.transform.parent = null;
Char.transform.position.y += 0.04;
Char.transform.rotation.x = 0.00;
Char.transform.rotation.y = Car.transform.rotation.y;
Char.transform.rotation.z = 0.00;
}
}
}
}