Пример #1
0
    // Update is called once per frame
    void Update()
    {
        car.SetSteer(Mathf.Clamp(Input.GetAxis("Horizontal"), -1, 1) * 45);
        car.SetThrottle(Mathf.Clamp(Input.GetAxis("Vertical"), -1, 1));

        car.SetBrake((Input.GetButton("Brake") ? 1 : 0) * 100f);
    }
Пример #2
0
 public void SetSteer(float value)
 {
     value = Mathf.Clamp(value, -45, 45);
     car.SetSteer(value);
 }