How do I set the stop time or slowdown for a NavMesh agent at the end of a path?

Hi guys. I’m trying to make a very simple thing, a controller for NavMeshAgent. In which I can set the speed of the character and the time before the character fully accelerates and stops.

For example, by setting the speed to 5 and the acceleration time to 0.5, I get an acceleration output of 10, which means that the object will accelerate to the maximum in 0.5 seconds.

However, I can’t figure out if it is possible to control the deceleration of the object as well?

NavMeshAgent has an AutoBraking flag that automatically slows down the object before reaching the target, but no matter what parameters are specified, the deceleration always happens with the same delay. It seems that neither the speed nor the acceleration affect this. When the flag is turned off, the object stops immediately, as well as when StoppingDistance is specified.

I understand that I can directly control the speed, acceleration and other parameters, such as NavMeshAgent.velocity, NavMeshAgent.Move(), but then it just doesn’t make sense. I use NаvMesh specifically for automation and to avoid manual handling of movement.

private float _movementSpeed;
private float _movementStartDuration;
public float TargetPosition;
public Initialize()
    {
        _movementSpeed = 5;
        _movementStartDuration = 0.5f;

        _navMeshAgent = _FSM.Enemy.GetComponent<NavMeshAgent>();

        _navMeshAgent.speed = _movementSpeed;
        _navMeshAgent.acceleration = _movementSpeed / _movementStartDuration;
        _navMeshAgent.SetDestination(TargetPosition);
    }

Found something similar in the tutorial Adventure - Sample Game

private void Update()
{
    // Cache the speed that nav mesh agent wants to move at.
    float speed = agent.desiredVelocity.magnitude;
    // If the nav mesh agent is very close to it's destination, call the Stopping function.
    if (agent.remainingDistance <= agent.stoppingDistance * stopDistanceProportion)
        Stopping (out speed);
    // Otherwise, if the nav mesh agent is close to it's destination, call the Slowing function.
    else if (agent.remainingDistance <= agent.stoppingDistance)
        Slowing(out speed, agent.remainingDistance);
    // Otherwise, if the nav mesh agent wants to move fast enough, call the Moving function.
    else if (speed > turnSpeedThreshold)
        Moving ();
    
    // Set the animator's Speed parameter based on the (possibly modified) speed that the nav mesh agent wants to move at.
    animator.SetFloat(hashSpeedPara, speed, speedDampTime, Time.deltaTime);
}
// This is called when the nav mesh agent is close to its destination but not so close it's position should snap to it's destination.
private void Slowing (out float speed, float distanceToDestination)
{
    // Although the player will continue to move, it will be controlled manually so stop the nav mesh agent.
    agent.isStopped = true;

    // Find the distance to the destination as a percentage of the stopping distance.
    float proportionalDistance = 1f - distanceToDestination / agent.stoppingDistance;

    // The target rotation is the rotation of the interactionLocation if the player is headed to an interactable, or the player's own rotation if not.
    Quaternion targetRotation = currentInteractable ? currentInteractable.interactionLocation.rotation : transform.rotation;

    // Interpolate the player's rotation between itself and the target rotation based on how close to the destination the player is.
    transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, proportionalDistance);

    // Move the player towards the destination by an amount based on the slowing speed.
    transform.position = Vector3.MoveTowards(transform.position, destinationPosition, slowingSpeed * Time.deltaTime);

    // Set the speed (for use by the animator) to a value between slowing speed and zero based on the proportional distance.
    speed = Mathf.Lerp(slowingSpeed, 0f, proportionalDistance);
}