diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index ee8949e..bae5b32 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -232,7 +232,7 @@ carMass: 1000 carMesh: {fileID: -2432090755550338912, guid: 6358fc72c8f1a5645b372c8756ff9871, type: 3} carMaterial: {fileID: 2100000, guid: 55dd6bb7e89b75f4b9958b0b7bb7c5d2, type: 2} - power: 10000 + power: 2500 travelTimes: [] trafficLights: {fileID: 128843417} cameraControl: {fileID: 1256630291} diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index ee8949e..bae5b32 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -232,7 +232,7 @@ carMass: 1000 carMesh: {fileID: -2432090755550338912, guid: 6358fc72c8f1a5645b372c8756ff9871, type: 3} carMaterial: {fileID: 2100000, guid: 55dd6bb7e89b75f4b9958b0b7bb7c5d2, type: 2} - power: 10000 + power: 2500 travelTimes: [] trafficLights: {fileID: 128843417} cameraControl: {fileID: 1256630291} diff --git a/Assets/Scripts/Car/Car.cs b/Assets/Scripts/Car/Car.cs index cd451a7..6f80d5e 100644 --- a/Assets/Scripts/Car/Car.cs +++ b/Assets/Scripts/Car/Car.cs @@ -124,7 +124,7 @@ } private bool isBraking() { - float stoppingDistance = brakingDistance + 3f; + float stoppingDistance = brakingDistance + 3f + 1.8f * speed + 1f; Road currentRoad = road; float currentRoadPosition = roadPositon; int currentRoadIndex = roadIndex; @@ -146,8 +146,8 @@ if (currentRoad != road && currentRoad.nodes[0] is CustomNode && !((CustomNode)currentRoad.nodes[0]).isPassable && - needsBraking(totalDistance - 2f, 0f)) { - + totalDistance - 2f > brakingDistance && + needsBraking(totalDistance - 3f, 0f)) { return true; } }