Moving the player to a fixed point on the Z-axis smoothly in a 3D sidescroller

Hi! I’m making my first real game, it’s a 3D game similar to getting over it but with a bouncing ball and click to jump controls. I want to move the player at one point of the level to a fixed location on the Z-axis and back again once that part of the level has been completed. I created an empty game object with an trigger box collider that covers the entire section and used to following code

private void OnTriggerEnter(Collider other)
    {
        if (other.transform.CompareTag("ChangePositionZ"))
        {
            transform.Translate(0, 0, 3);

        }
    }

    private void OnTriggerExit(Collider other)
    {
        if (other.transform.CompareTag("ChangePositionZ"))
        {
            transform.Translate(0, 0, -3);

        }
    }

It works as intended except that it moves too quickly which creates an unnatural movement. I tried using the Vector3.MoveTowards but could not get it to work. I’m very new to game development and I might be taking the wrong approach. Any help on this matter would be greatly appreciated