I’m a beginner in scripting with c#/javascript. However, I mainly use Javascript.
I am trying to make a car simply move,But when I was confident that my code was correctly displayed without errors for my car game,
this came up:
Assets/Quickscripts/CarControl.js(9,14): BCE0044: expecting ), found ‘=’.
Assets/Quickscripts/CarControl.js(9,14): BCE0043: Unexpected token: true.
Here is my script:
(Please note that I am not done with my script and I am just trying to fix the part that I am confused on.)
//Signals the car to go forward if true
var forward = false;
//Signals the car to go reverse if true
var reverse = false;
function update() {
if(Input.GetKeyDown ("w")) {
forward = true;
}
if(forward = true) {
transform.Translate(Vector3.forward * Time.deltaTime);
}
}
And with many other scripts has this happened to me! Please help me