Car AI to follow a player

i want to make a police car follow a player but the curve of the vehicle is very heavy and the movement is still very slow, I wanted it to be a little lighter, like a vehicle driven by a player.

here´s the code
Thanks for helping :slight_smile:

using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Reflection.Emit;
using System.Security.Cryptography;
using UnityEngine;
using UnityEngine.AI;


public class viatura : MonoBehaviour
{
    float aceleração, ré, curva;
    public float ForcaDoMotor, ControleDeCurva, ForçaDoFreio;
    public WheelCollider DianteiraDireita, DianteiraEsquerda, TraseiraDireita, TraseiraEsquerda;
    public GameObject player;

    Transform LocalDoPlayer;
    float MaxAnguloDaRoda = 30;
    Vector3 Jogador;
    // Update is called once per frame
    public void start()
    {

        Jogador = player.transform.position;

    }

    public void Update()
    {
        Vector3 ViaturaVector = transform.InverseTransformPoint(player.transform.position);
        float angulo = (ViaturaVector.x / ViaturaVector.magnitude) * MaxAnguloDaRoda;
        TraseiraDireita.motorTorque = ForcaDoMotor;
        TraseiraEsquerda.motorTorque = ForcaDoMotor;


        DianteiraDireita.steerAngle = angulo;
        DianteiraEsquerda.steerAngle = angulo;


    }

}

Hey and welcome. I know this wont be a very helpful answer regarding your actual question, but…

  • I have mostly no idea what the code does because it’s not written in a language i can understand. Doing it this way is of course your right, but as soon as more than one person needs to be able to understand the code it should be written in a language all participants understand. This includes asking people for help on it. The longer the code example, the harder it will be to find anybody able or willing to help you with it in the future. It’s always good practice to write code in english, which will also be uniform to the Unity API and generally improve readability.
  • ‘start()’ wont be called by Unity, you probably meant Start(). Capitalization is important! On that note, following common coding conventions you’d want to name class, method and property names in UpperCamelCase while naming variables in camelCase. You do not seem to follow any naming conventions at all.
  • Independant of the above advice, avoid using special characters like é, ö, … when naming identifiers. Not sure if Unity handles this properly for all builds, but as a rule of thumb this will eventually cause problems and require a lot of refactoring so i’d just stay away from it. I personally wouldnt even use them in comments, but certainly not in variables.