(Unity 2D) How to add acceleration and deceleration to an object that moves to a destination clicked on by my mouse?

Good day to you all.

I’m relatively new to unity 2d and I am trying to create a game where the player moves from one place to another by point-and-clicking with the mouse. I would like to add an acceleration to when they start moving from 0 to MaxSpeed and from MaxSpeed to 0 when they get close to their destination, instead of an instant acceleration.

I am kind of hoping to not require forces to achieve this.

My code currently looks like this:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BotMover : MonoBehaviour
{
    [SerializeField] private Camera mainCamera;
    private Vector3 targ;
    public float MaxSpeed = 3f;
    float currentSpeed = 0f;
    public float accelFactor = 0.02f;
    void Start()
    { 
        targ = transform.position;  
    }
    // Update is called once per frame
    void Update()
    {
        PositionalMover(MaxSpeed);
        //currentSpeed = 0f;
    }
    void PositionalMover(float s){
        if(Input.GetMouseButtonDown(0)){
            targ = mainCamera.ScreenToWorldPoint(Input.mousePosition);
            targ.z = transform.position.z;
        }
        transform.position = Vector3.MoveTowards(transform.position, targ, s * Time.deltaTime);  
    }
}

Greetings, @Aadi880

I’ve used the shape of the Sine function to ease in and ease out. Just drop this onto your 2D Sprite and it should work fine. Let me know if you have any problems.

using UnityEngine;

public class EaseMove : MonoBehaviour
{
    Vector3 startPos;
    Vector3 endPos;
    float distance;
    Vector3 direction;
    float maxSpeed = 10;
    Rigidbody2D rb;
    bool moving = false;

    void Start()
    {
        rb = GetComponent<Rigidbody2D>();
    }

    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            InitialiseMove();
        }
    }

    void FixedUpdate()
    {
        if (moving)
        {
            rb.velocity = CalculateVelocity();
            CheckArrival();
        }
    }

    void InitialiseMove()
    {
        startPos = transform.position;
        endPos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
        endPos.z = transform.position.z;
        distance = (endPos - startPos).magnitude;
        direction = (endPos - startPos).normalized;
        moving = true;
    }

    void CheckArrival()
    {
        if ((endPos - transform.position).magnitude < 0.3)
        {
            transform.position = endPos;
            rb.velocity = Vector3.zero;
            moving = false;
        }
    }

    Vector3 CalculateVelocity()
    {
        float travelled = (transform.position - startPos).magnitude;
        float speed = (Mathf.Sin(travelled / distance * Mathf.PI)) * maxSpeed;
        return (speed + 1) * direction;
    }
}