diff --git a/BottomGear/Assets/Game/Assets/Materials/Physics/Car.physicMaterial b/BottomGear/Assets/Game/Assets/Materials/Physics/Car.physicMaterial index e2d7e822..26defef8 100644 --- a/BottomGear/Assets/Game/Assets/Materials/Physics/Car.physicMaterial +++ b/BottomGear/Assets/Game/Assets/Materials/Physics/Car.physicMaterial @@ -7,8 +7,8 @@ PhysicMaterial: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: Car - dynamicFriction: 0 - staticFriction: 0 + dynamicFriction: 0.6 + staticFriction: 0.6 bounciness: 1 frictionCombine: 0 - bounceCombine: 0 + bounceCombine: 2 diff --git a/BottomGear/Assets/Game/Scenes/TestScenes/Vehicle.unity b/BottomGear/Assets/Game/Scenes/TestScenes/Vehicle.unity index c2171d73..c85b66ca 100644 --- a/BottomGear/Assets/Game/Scenes/TestScenes/Vehicle.unity +++ b/BottomGear/Assets/Game/Scenes/TestScenes/Vehicle.unity @@ -525,9 +525,13 @@ PrefabInstance: propertyPath: m_Drag value: 0 objectReference: {fileID: 0} + - target: {fileID: 865184823, guid: 75980be8169e8844595d320b13a7e456, type: 3} + propertyPath: m_Mass + value: 1000 + objectReference: {fileID: 0} - target: {fileID: 865184823, guid: 75980be8169e8844595d320b13a7e456, type: 3} propertyPath: m_AngularDrag - value: 0 + value: 0.5 objectReference: {fileID: 0} - target: {fileID: 865184823, guid: 75980be8169e8844595d320b13a7e456, type: 3} propertyPath: m_CollisionDetection @@ -541,13 +545,21 @@ PrefabInstance: propertyPath: test value: 0 objectReference: {fileID: 0} + - target: {fileID: 1817820544, guid: 75980be8169e8844595d320b13a7e456, type: 3} + propertyPath: maxAngle + value: 30 + objectReference: {fileID: 0} + - target: {fileID: 1817820544, guid: 75980be8169e8844595d320b13a7e456, type: 3} + propertyPath: maxSpeed + value: 30 + objectReference: {fileID: 0} - target: {fileID: 1817820544, guid: 75980be8169e8844595d320b13a7e456, type: 3} propertyPath: maxTorque value: 2500 objectReference: {fileID: 0} - target: {fileID: 1817820544, guid: 75980be8169e8844595d320b13a7e456, type: 3} propertyPath: criticalSpeed - value: 5 + value: 20 objectReference: {fileID: 0} - target: {fileID: 1864884027688733411, guid: 75980be8169e8844595d320b13a7e456, type: 3} propertyPath: m_Name diff --git a/BottomGear/Assets/Game/Scripts/Car/WheelDrive.cs b/BottomGear/Assets/Game/Scripts/Car/WheelDrive.cs index 7f235edf..736d65ff 100644 --- a/BottomGear/Assets/Game/Scripts/Car/WheelDrive.cs +++ b/BottomGear/Assets/Game/Scripts/Car/WheelDrive.cs @@ -33,6 +33,8 @@ public class WheelDrive : MonoBehaviour public float criticalSpeed = 5f; [Tooltip("The vehicle's limit speed.")] public float maxSpeed = 30; + [Tooltip("The vehicle's acceleration multiplier.")] + public float acceleration = 5.0f; [Tooltip("Simulation sub-steps when the speed is above critical.")] public int stepsBelow = 5; [Tooltip("Simulation sub-steps when the speed is below critical.")] @@ -108,6 +110,8 @@ void Update() { torque = 0; } + else + rb.AddForce(transform.forward * acceleration * Input.GetAxis("Vertical"), ForceMode.Acceleration); float handBrake = Input.GetKey(KeyCode.X) ? brakeTorque : 0; @@ -131,6 +135,7 @@ void Update() && driveType != DriveType.FrontWheelDrive) { wheel.motorTorque = torque; + } if (m_Wheels[i].mesh.name == "Wheel1Mesh"