new car control
This commit is contained in:
@@ -9,7 +9,6 @@ public class carcontrolv2 : MonoBehaviour
|
||||
public float maxSpeed = 20;
|
||||
public float steeringRange = 30;
|
||||
public float steeringRangeAtMaxSpeed = 10;
|
||||
public float centreOfGravityOffset = -1f;
|
||||
|
||||
WheelControl[] wheels;
|
||||
Rigidbody rigidBody;
|
||||
@@ -19,9 +18,6 @@ public class carcontrolv2 : MonoBehaviour
|
||||
{
|
||||
rigidBody = GetComponent<Rigidbody>();
|
||||
|
||||
// Adjust center of mass vertically, to help prevent the car from rolling
|
||||
rigidBody.centerOfMass += Vector3.up * centreOfGravityOffset;
|
||||
|
||||
// Find all child GameObjects that have the WheelControl script attached
|
||||
wheels = GetComponentsInChildren<WheelControl>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user