I am trying to make a simple car game but whenever i am pressing up arrow the car is moving to right. This is the code i am using and attached to the car gameobject
public WheelCollider wheelFL, wheelFR, wheelRL, wheelRR;
public float maxTorque = 50f;
public float steerFactor = 10f;
void Start ()
{
rigidbody.mass = 1500f;
rigidbody.centerOfMass = new Vector3(0f, -0.9f, 0f);
}
void FixedUpdate ()
{
wheelRR.motorTorque = maxTorque * Input.GetAxis("Vertical");
wheelRL.motorTorque = maxTorque * Input.GetAxis("Vertical");
wheelFL.steerAngle = steerFactor * Input.GetAxis("Horizontal");
wheelFR.steerAngle = steerFactor * Input.GetAxis("Horizontal");
}
Here is how wheel colliders are set