Acceleration curve formula

Hi guys
I am working on a simple car game.
However I am not sure how to make car accelerate based on the curve…
I have a variable for max speed and I am using get.axis horizontal for throttle.
What I want to accomplish is make my car accelerate fast at first and start slowing down with acceleration when it gets close to max speed.

Not sure what you mean by “the curve” - but if you define a max initial acceleration and know that as you approach max speed you want acceleration to approach 0 then you could easily scale your current acceleration accordingly:

var horizontal = Input.GetAxis("Horizontal");
var acceleration = MaxInitialAcceleration * horizontal;
acceleration *= Mathf.Clamp(1.0f - (currentVelocity / MaxSpeed), 0.0f, 1.0f);
currentVelocity += acceleration * Time.deltaTime;

That’s the concept anyways, you’ll have to appropriate it to your current model depending on whether you’re using Rigidbody and are operating in Update() or FixedUpdate(), etc.