Пример #1
0
    private void Update()
    {
        var hits   = rayCastSensors.GetHitInformations();
        var output = aiModel.eval(hits.Select(hit => hit.distance).ToArray());

        kartController.ApplyAcceleration(output[0]);
        kartController.Steer(output[1] * 2.0f - 1.0f);
    }
Пример #2
0
    void Update()
    {
        forward = Input.GetAxis("Vertical");
        turn    = Input.GetAxis("Horizontal");
        brake   = Input.GetButton("Jump");

        kart.ApplyAcceleration(forward);
        kart.Steer(turn);
    }