Esempio n. 1
0
    private void LateUpdate()
    {
        if (controlSwitch_present && !controlSwitch.GetManualDrivingState())
        {
            SmoothedSteering();
        }
        else
        {
            DirectSteering();
        }

        //float LerpedSteering = Mathf.SmoothDamp(currentWheelSteering, carController.GetSterring(), ref smoothvalue,
        //   Time.deltaTime);
        // Debug.Log(LerpedSteering);
        //this.transform.localRotation = Quaternion.Euler(xRot,0,LerpedSteering*540);
        currentWheelSteering = LerpedSteering;
    }
Esempio n. 2
0
 private void Update()
 {
     target  = _carController.GetSterring();
     current = _manualController.GetSteeringInput();
     if (!_controlSwitch.GetManualDrivingState())
     {
         int sign = 0;
         if ((current - target) > 0)
         {
             sign = -1;
         }
         else
         {
             sign = 1;
         }
         SetAutoPilotForceFeedbackEffect(8000 * sign * (Mathf.Abs(current) - Mathf.Abs(target)));
     }
 }