I found this script which, supposedly, should help me with my car physics issue. The problem is that I get this error everytime I try to add new sript to my main script
Assets/Scripts/Car Control/PlayerCar_Script.js(61,6): UCE0001: ';' expected. Insert a semicolon at the end.
Here’s the script itself
private void Awake()
{
// _currentRotation is defined elsewhere in the class
_currentRotation = new Vector3(transform.localEulerAngles.x, transform.localEulerAngles.y, transform.localEulerAngles.z);
}
private void LateUpdate()
{
// whenever the car is intended to be going straight we adjust localEulerAngle; if the user steers we do not interfere but adjust the rotation angle to allow for correct further calculation
// _steer is defined elsewhere and
// is taken from the user in FixedUpdate()
// as follows: _steer = Input.GetAxis("Horizontal");
if (_steer == 0)
{
float y = _currentRotation.y;
transform.localEulerAngles = new Vector3(transform.localEulerAngles.x, y, transform.localEulerAngles.z);
}
else
_currentRotation.y = transform.localEulerAngles.y;
}
The line error message referring to is
float y = _currentRotation.y;
As you can see the is already a semicolon there.
I have very, very limited knowledge in programming, but I have a suspicion that the script is written in C and my main script is written in Java. If this is the issue, could somebody tell me what I need to change to make this script work?