diff --git a/Assets/Scripts/Pathfinding/Hybrid A star/HybridAStar.cs b/Assets/Scripts/Pathfinding/Hybrid A star/HybridAStar.cs index 0d8c8a2..82ee2e9 100644 --- a/Assets/Scripts/Pathfinding/Hybrid A star/HybridAStar.cs +++ b/Assets/Scripts/Pathfinding/Hybrid A star/HybridAStar.cs @@ -454,7 +454,7 @@ private static List GetChildrenToNode(Node currentNode, Map map, Cell[,] c float alpha = steeringAngles[j]; //Turning angle - float beta = (driveDistance / carData.WheelBase) * Mathf.Tan(alpha); + float beta = (driveDistance / carData.WheelBase) * Mathf.Sin(alpha); //Simulate the car driving forward by using a mathematical car model Vector3 newRearWheelPos = VehicleSimulationModels.CalculateNewPosition(heading, beta, driveDistance, currentNode.rearWheelPos);