Hi, I'm trying to make my first car-game work.
var leftWheel = WheelCollider;
var rightwheel = WheelCollider;
var maxtorque = 260.0;
function Start () {
rigidbody.centerOfMass.y = 0;
}
function FixedUpdate () {
leftWheel.motorTorque = maxtorque * Input.GetAxis("Vertical");
rightwheel.motorTorque = maxtorque * Input.GetAxis("Vertical");
leftWheel.steerAngle = 10 * Input.GetAxis("Horizontal");
rightwheel.steerAngle = 10 * Input.GetAxis("Horizontal");
}
This script produces an error I can't understand.
Assets/Driving.js(10,19): BCE0019: 'motorTorque' is not a member of 'System.Type'. Assets/Driving.js(11,20): BCE0019: 'motorTorque' is not a member of 'System.Type'. Assets/Driving.js(13,19): BCE0019: 'steerAngle' is not a member of 'System.Type'. Assets/Driving.js(14,20): BCE0019: 'steerAngle' is not a member of 'System.Type'.
What went wrong here and how can I fix it?
Thanks - dark andy