Explorar el Código

Reset steering, when disabled

Marcel Zickler hace 3 años
padre
commit
4ee99f976f
Se han modificado 1 ficheros con 9 adiciones y 0 borrados
  1. 9 0
      Assets/Scripts/TrafficSimulation/WheelDrive.cs

+ 9 - 0
Assets/Scripts/TrafficSimulation/WheelDrive.cs

@@ -84,6 +84,15 @@ namespace TrafficSimulation{
                 wheel.ConfigureVehicleSubsteps(10, 1, 1);
             }
         }
+        private void OnDisable()
+        {
+            ResetWheels();
+        }
+        private void ResetWheels()
+        {
+            Debug.Log("Reset Steering!");
+            this.currentSteering = 0f;
+        }
 
         public void Move(float _acceleration, float _steering, float _brake)
         {